Class: Idml::Render::Footnote::Counter

Inherits:
Object
  • Object
show all
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

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_numberObject



33
34
35
36
37
# File 'lib/idml/render/footnote.rb', line 33

def next_number
  value = @next
  @next += 1
  value
end