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