Class: Pageboy::Collator
- Inherits:
-
Object
- Object
- Pageboy::Collator
- Includes:
- Enumerable
- Defined in:
- lib/pageboy/collator.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(page_turner) ⇒ Collator
constructor
A new instance of Collator.
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 |