Class: Baldrick::Listeners::FeedListener
- Inherits:
-
Object
- Object
- Baldrick::Listeners::FeedListener
- Defined in:
- lib/baldrick/listeners/feed_listener.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ FeedListener
constructor
A new instance of FeedListener.
- #orders ⇒ Object
Constructor Details
#initialize(options) ⇒ FeedListener
Returns a new instance of FeedListener.
6 7 8 9 10 |
# File 'lib/baldrick/listeners/feed_listener.rb', line 6 def initialize @url = [:at] # just don't go trying to consume feeds before 1970 @time_of_last_order = Time.at 0 end |
Instance Method Details
#orders ⇒ Object
12 13 14 15 |
# File 'lib/baldrick/listeners/feed_listener.rb', line 12 def orders content = open(@url){|f| f.read} select_new_orders_from FeedOrders.within(content) end |