Class: Coradoc::Element::Inline::Footnote

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/element/inline/footnote.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/coradoc/element/inline/footnote.rb', line 5

def id
  @id
end

#textObject

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_adocObject



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