Class: RuBB::Node::Simple
- Inherits:
-
RuBB::Node
- Object
- RuBB::Node
- RuBB::Node::Simple
- Defined in:
- lib/rubb/node/simple.rb
Instance Attribute Summary collapse
-
#html_tag_name ⇒ Object
Returns the value of attribute html_tag_name.
Attributes inherited from RuBB::Node
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Simple
constructor
A new instance of Simple.
- #to_html ⇒ Object
Methods inherited from RuBB::Node
Constructor Details
#initialize(options = {}) ⇒ Simple
Returns a new instance of Simple.
6 7 8 9 |
# File 'lib/rubb/node/simple.rb', line 6 def initialize(={}) super() @html_tag_name = [:html_tag_name] || '' end |
Instance Attribute Details
#html_tag_name ⇒ Object
Returns the value of attribute html_tag_name.
4 5 6 |
# File 'lib/rubb/node/simple.rb', line 4 def html_tag_name @html_tag_name end |
Instance Method Details
#to_html ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/rubb/node/simple.rb', line 11 def to_html html = "<#{@html_tag_name}>" @children.each do |child| html += child ? child.to_html : '' end html + "</#{@html_tag_name}>" end |