Module: Terror::Helper
- Defined in:
- lib/terror/helper.rb
Instance Method Summary collapse
- #config ⇒ Object
- #each_post ⇒ Object
- #newer_page ⇒ Object
- #newer_page? ⇒ Boolean
- #older_page ⇒ Object
- #older_page? ⇒ Boolean
- #rfc_3339(time) ⇒ Object
Instance Method Details
#each_post ⇒ Object
7 8 9 10 11 12 |
# File 'lib/terror/helper.rb', line 7 def each_post @posts.each do |post| date = Date.parse(post.date.to_s) yield(post, @current_date != date ? @current_date = date : nil) end end |
#newer_page ⇒ Object
22 23 24 |
# File 'lib/terror/helper.rb', line 22 def newer_page @posts.current_page - 1 end |
#newer_page? ⇒ Boolean
18 19 20 |
# File 'lib/terror/helper.rb', line 18 def newer_page? @posts.current_page > 1 end |
#older_page ⇒ Object
30 31 32 |
# File 'lib/terror/helper.rb', line 30 def older_page @posts.current_page + 1 end |
#older_page? ⇒ Boolean
26 27 28 |
# File 'lib/terror/helper.rb', line 26 def older_page? @posts.total_pages > @posts.current_page end |
#rfc_3339(time) ⇒ Object
14 15 16 |
# File 'lib/terror/helper.rb', line 14 def rfc_3339(time) time.strftime("%Y-%m-%dT%H:%M:%SZ") if time end |