Class: VirtualFeed
- Inherits:
-
Object
- Object
- VirtualFeed
- Defined in:
- lib/virtual_feed.rb
Instance Attribute Summary collapse
-
#entries ⇒ Object
Returns the value of attribute entries.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #entry_count ⇒ Object
- #finder_params ⇒ Object
- #finder_params=(hash) ⇒ Object
- #last_updated ⇒ Object
-
#reload ⇒ Object
This is to make the Virtual Feed walk like a duck.
Instance Attribute Details
#entries ⇒ Object
Returns the value of attribute entries.
3 4 5 |
# File 'lib/virtual_feed.rb', line 3 def entries @entries end |
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/virtual_feed.rb', line 2 def title @title end |
Instance Method Details
#entry_count ⇒ Object
27 28 29 |
# File 'lib/virtual_feed.rb', line 27 def entry_count Entry.count(finder_params) end |
#finder_params ⇒ Object
15 16 17 18 |
# File 'lib/virtual_feed.rb', line 15 def finder_params # To prevent ActiveRecord from altering the hash when passed into #find @finder_params.clone end |
#finder_params=(hash) ⇒ Object
5 6 7 8 |
# File 'lib/virtual_feed.rb', line 5 def finder_params=(hash) LOGGER.debug("setting finder params to #{hash.inspect}") @finder_params = hash end |
#last_updated ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/virtual_feed.rb', line 31 def last_updated if entries.empty? nil else entry = Entry.find(:first, finder_params) entry.date_published || entry.updated_at end end |
#reload ⇒ Object
This is to make the Virtual Feed walk like a duck
11 12 13 |
# File 'lib/virtual_feed.rb', line 11 def reload self end |