Class: Idml::Render::Footnote::Counter
- Inherits:
-
Object
- Object
- Idml::Render::Footnote::Counter
- Defined in:
- lib/idml/render/footnote.rb
Overview
Story-scoped sequential counter. Mutated as csr_runs walks the story's style ranges so footnotes number in document order across paragraphs.
Instance Method Summary collapse
-
#initialize(start_at = nil) ⇒ Counter
constructor
A new instance of Counter.
- #next_number ⇒ Object
Constructor Details
#initialize(start_at = nil) ⇒ Counter
Returns a new instance of Counter.
29 30 31 |
# File 'lib/idml/render/footnote.rb', line 29 def initialize(start_at = nil) @next = start_at || 1 end |
Instance Method Details
#next_number ⇒ Object
33 34 35 36 37 |
# File 'lib/idml/render/footnote.rb', line 33 def next_number value = @next @next += 1 value end |