Class: Inkcite::Renderer::Footnote::Instance
- Inherits:
-
Object
- Object
- Inkcite::Renderer::Footnote::Instance
- Defined in:
- lib/inkcite/renderer/footnote.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
(also: #active?)
True if this footnote is active.
-
#id ⇒ Object
readonly
Optional, unique ID assigned by the designer for this footnote so that a numeric footnote can be referenced repeatedly, non-linearly throughout the email.
-
#symbol ⇒ Object
Symbol associated with the footnote.
-
#text ⇒ Object
readonly
The message associated with the footnote that will be displayed when the footnotes tag is rendered.
Instance Method Summary collapse
-
#initialize(id, symbol, text, active = true) ⇒ Instance
constructor
A new instance of Instance.
- #number ⇒ Object
-
#numeric? ⇒ Boolean
Returns true if this footnote is numeric rather than a symbol - e.g.
- #symbol? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(id, symbol, text, active = true) ⇒ Instance
Returns a new instance of Instance.
26 27 28 29 30 31 |
# File 'lib/inkcite/renderer/footnote.rb', line 26 def initialize id, symbol, text, active=true @id = id @symbol = symbol.to_s @text = text @active = active end |
Instance Attribute Details
#active ⇒ Object Also known as: active?
True if this footnote is active. By default all footnotes are activate but those read from footnotes.tsv are inactive until referenced in the source.
23 24 25 |
# File 'lib/inkcite/renderer/footnote.rb', line 23 def active @active end |
#id ⇒ Object (readonly)
Optional, unique ID assigned by the designer for this footnote so that a numeric footnote can be referenced repeatedly, non-linearly throughout the email.
10 11 12 |
# File 'lib/inkcite/renderer/footnote.rb', line 10 def id @id end |
#symbol ⇒ Object
Symbol associated with the footnote. Typically going to be numeric but could be a user-specified symbol - e.g. †.
14 15 16 |
# File 'lib/inkcite/renderer/footnote.rb', line 14 def symbol @symbol end |
#text ⇒ Object (readonly)
The message associated with the footnote that will be displayed when the footnotes tag is rendered.
18 19 20 |
# File 'lib/inkcite/renderer/footnote.rb', line 18 def text @text end |
Instance Method Details
#number ⇒ Object
33 34 35 |
# File 'lib/inkcite/renderer/footnote.rb', line 33 def number @symbol.to_i end |
#numeric? ⇒ Boolean
Returns true if this footnote is numeric rather than a symbol - e.g. †
39 40 41 |
# File 'lib/inkcite/renderer/footnote.rb', line 39 def numeric? @symbol == @symbol.to_i.to_s end |
#symbol? ⇒ Boolean
47 48 49 |
# File 'lib/inkcite/renderer/footnote.rb', line 47 def symbol? !numeric? end |
#to_s ⇒ Object
51 52 53 |
# File 'lib/inkcite/renderer/footnote.rb', line 51 def to_s "#{symbol} #{text}" end |