Class: HParser::Block::FootnoteList
- Inherits:
-
Object
- Object
- HParser::Block::FootnoteList
- Defined in:
- lib/hparser/html.rb,
lib/hparser/text.rb,
lib/hparser/block/footnote_list.rb
Instance Attribute Summary collapse
-
#footnotes ⇒ Object
readonly
Returns the value of attribute footnotes.
Instance Method Summary collapse
- #==(o) ⇒ Object
- #html_content ⇒ Object
-
#initialize(footnotes) ⇒ FootnoteList
constructor
A new instance of FootnoteList.
- #to_html ⇒ Object
- #to_text ⇒ Object
Constructor Details
#initialize(footnotes) ⇒ FootnoteList
Returns a new instance of FootnoteList.
10 11 12 |
# File 'lib/hparser/block/footnote_list.rb', line 10 def initialize(footnotes) @footnotes = footnotes end |
Instance Attribute Details
#footnotes ⇒ Object (readonly)
Returns the value of attribute footnotes.
8 9 10 |
# File 'lib/hparser/block/footnote_list.rb', line 8 def footnotes @footnotes end |
Instance Method Details
#==(o) ⇒ Object
14 15 16 |
# File 'lib/hparser/block/footnote_list.rb', line 14 def ==(o) self.class == o.class and self.footnotes == o.footnotes end |
#html_content ⇒ Object
277 278 279 280 281 |
# File 'lib/hparser/html.rb', line 277 def html_content @footnotes.map {|f| %(<p class="footnote"><a href="#fn#{f.index}" name="f#{f.index}">*#{f.index}</a>: #{f.text}</p>) }.join end |
#to_html ⇒ Object
273 274 275 |
# File 'lib/hparser/html.rb', line 273 def to_html %(<div class="footnote">#{self.html_content}</div>) end |
#to_text ⇒ Object
136 137 138 139 140 |
# File 'lib/hparser/text.rb', line 136 def to_text @footnotes.map {|f| %((*#{f.index}) #{f.text}) }.join("\n") end |