class Inkcite::Renderer::Footnote::Instance

Attributes

active[RW]

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.

active?[RW]

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.

id[R]

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[R]

Symbol associated with the footnote. Typically going to be numeric but could be a user-specified symbol - e.g. †.

text[R]

The message associated with the footnote that will be displayed when the {footnotes} tag is rendered.

Public Class Methods

new(id, symbol, text, active=true) click to toggle source
# 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

Public Instance Methods

number() click to toggle source
# File lib/inkcite/renderer/footnote.rb, line 33
def number
  @symbol.to_i
end
numeric?() click to toggle source

Returns true if this footnote is numeric rather than a symbol - e.g. †

# File lib/inkcite/renderer/footnote.rb, line 39
def numeric?
  @symbol == @symbol.to_i.to_s
end
symbol=(symbol) click to toggle source
# File lib/inkcite/renderer/footnote.rb, line 43
def symbol=symbol
  @symbol = symbol.to_s
end
symbol?() click to toggle source
# File lib/inkcite/renderer/footnote.rb, line 47
def symbol?
  !numeric?
end
to_s() click to toggle source
# File lib/inkcite/renderer/footnote.rb, line 51
def to_s
  "#{symbol} #{text}"
end