Class: Baldrick::Listeners::FeedListener

Inherits:
Object
  • Object
show all
Defined in:
lib/baldrick/listeners/feed_listener.rb

Instance Method Summary collapse

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 options
  @url = options[:at]
  # just don't go trying to consume feeds before 1970
  @time_of_last_order = Time.at 0
end

Instance Method Details

#ordersObject



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