Class: Ruby::Tags::NonVoid
- Inherits:
-
Object
- Object
- Ruby::Tags::NonVoid
- Defined in:
- lib/ruby/tags/tags.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #add(tag) ⇒ Object
-
#initialize(name, *renders) ⇒ NonVoid
constructor
A new instance of NonVoid.
- #render ⇒ Object
Constructor Details
Instance Method Details
#==(other) ⇒ Object
56 57 58 59 60 |
# File 'lib/ruby/tags/tags.rb', line 56 def ==(other) @name == other.instance_variable_get(:@name) && @attribute == other.instance_variable_get(:@attribute) && @children == other.instance_variable_get(:@children) end |
#add(tag) ⇒ Object
51 52 53 54 |
# File 'lib/ruby/tags/tags.rb', line 51 def add(tag) @children << tag self end |
#render ⇒ Object
47 48 49 |
# File 'lib/ruby/tags/tags.rb', line 47 def render @children.reduce("<#{@name}#{@attribute.render}>") { |m, t| m + t.render } + "</#{@name}>" end |