class PlaylyfeClient::V2::EventCollection
Public Class Methods
new(game, event_array=[], player_team_or_process=nil)
click to toggle source
# File lib/playlyfe_client/v2/collection/event_collection.rb, line 19 def initialize(game, event_array=[], player_team_or_process=nil) @game= game @items=[] event_array= game.connection.get_game_events_array if event_array == [] fill_items(event_array,player_team_or_process) end
Public Instance Methods
find(str)
click to toggle source
# File lib/playlyfe_client/v2/collection/event_collection.rb, line 10 def find(str) e=PlaylyfeClient::CollectionFindOneIsNotSupportedError.new e.name="Find item is not supported" e.message="This collections has no unique key, so no use for collection.find." raise e end
Private Instance Methods
fill_items(hash_array, player_team_or_process)
click to toggle source
# File lib/playlyfe_client/v2/collection/event_collection.rb, line 26 def fill_items(hash_array, player_team_or_process) hash_array.each do |event_hash| # binding.pry @items << PlaylyfeClient::V2::Event.build(event_hash, @game, player_team_or_process) end end