Class: RuBB::Node
- Inherits:
-
Object
- Object
- RuBB::Node
- Defined in:
- lib/rubb/node.rb,
lib/rubb/node/url.rb,
lib/rubb/node/text.rb,
lib/rubb/node/email.rb,
lib/rubb/node/image.rb,
lib/rubb/node/quote.rb,
lib/rubb/node/simple.rb,
lib/rubb/node/styled.rb
Defined Under Namespace
Classes: Email, Image, Quote, Simple, Styled, Text, URL
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
Instance Method Summary collapse
- #<<(child) ⇒ Object
-
#initialize(options = {}) ⇒ Node
constructor
A new instance of Node.
- #to_html ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Node
Returns a new instance of Node.
5 6 7 |
# File 'lib/rubb/node.rb', line 5 def initialize(={}) @children = [:children] || [] end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
3 4 5 |
# File 'lib/rubb/node.rb', line 3 def children @children end |
Instance Method Details
#<<(child) ⇒ Object
9 10 11 |
# File 'lib/rubb/node.rb', line 9 def <<(child) @children << child end |
#to_html ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/rubb/node.rb', line 13 def to_html html = '' @children.each do |child| html += child ? child.to_html : '' end html end |