Class: Pageboy::Collator

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/pageboy/collator.rb

Instance Method Summary collapse

Constructor Details

#initialize(page_turner) ⇒ Collator

Returns a new instance of Collator.



5
6
7
# File 'lib/pageboy/collator.rb', line 5

def initialize(page_turner)
  @page_turner = page_turner
end

Instance Method Details

#each(&block) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/pageboy/collator.rb', line 9

def each(&block)
  page = @page_turner.first
  while page
    page.items.each(&block)
    page = page.next
  end
end