| Module | Hobix::EntryEnum |
| In: |
lib/hobix/entry.rb
|
The EntryEnum class is mixed into an Array of entries just before passing on to a template. This Enumerator-like module provides some common iteration of entries.
Calls the block with two arguments: (1) a Time object with the earliest date of an issued post for that day; (2) an Array of entries posted that day, in chronological order.
# File lib/hobix/entry.rb, line 71
71: def each_day
72: last_day, day = nil, []
73: each do |e|
74: if last_day and last_day != e.day_id
75: yield day.first.created, day
76: day = []
77: end
78: last_day = e.day_id
79: day << e
80: end
81: yield day.first.created, day if last_day
82: end