lib/playlyfe_client/v2/game.rb in playlyfe_client-1.1.0 vs lib/playlyfe_client/v2/game.rb in playlyfe_client-1.1.1
- old
+ new
@@ -47,12 +47,17 @@
def image_data(style=:original)
data=connection.get_game_image_data
puts(data)
end
-
- def events
- @events ||= PlaylyfeClient::V2::EventCollection.new(self)
+
+ #results are cached if start_time is nil (events for last 24 hours), otherwise direct call to Playlyfe is made
+ def events(start_time=nil,end_time=nil)
+ if start_time.nil?
+ @events ||= PlaylyfeClient::V2::EventCollection.new(self)
+ else
+ PlaylyfeClient::V2::EventCollection.new(self, self.connection.get_game_events_array(start_time, end_time))
+ end
end
private
def initialize(conn)