Class: Coradoc::Element::Inline::Footnote
- Defined in:
- lib/coradoc/element/inline/footnote.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text, id = nil) ⇒ Footnote
constructor
A new instance of Footnote.
- #to_adoc ⇒ Object
Methods inherited from Base
access_children, #children_accessors, children_accessors, declare_children, #simplify_block_content, visit, #visit
Constructor Details
#initialize(text, id = nil) ⇒ Footnote
Returns a new instance of Footnote.
9 10 11 12 |
# File 'lib/coradoc/element/inline/footnote.rb', line 9 def initialize(text, id = nil) @text = text @id = id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/coradoc/element/inline/footnote.rb', line 5 def id @id end |
#text ⇒ Object
Returns the value of attribute text.
5 6 7 |
# File 'lib/coradoc/element/inline/footnote.rb', line 5 def text @text end |
Instance Method Details
#to_adoc ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/coradoc/element/inline/footnote.rb', line 14 def to_adoc if @id "footnote:#{@id}[#{@text}]" else "footnote:[#{@text}]" end end |