Class: Infostrada::MatchEventList

Inherits:
BaseRequest show all
Defined in:
lib/infostrada/match_event_list.rb

Constant Summary collapse

URL =
'/GetMatchActionList_All'

Constants inherited from BaseRequest

BaseRequest::RETRIES

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from BaseRequest

get!

Instance Attribute Details

#eventsObject

Returns the value of attribute events.



7
8
9
# File 'lib/infostrada/match_event_list.rb', line 7

def events
  @events
end

Class Method Details

.where(options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/infostrada/match_event_list.rb', line 9

def self.where(options = {})
  match_id = options.delete(:match_id)

  list = get!(URL, query: { matchid: match_id.to_i })

  events = []
  list.each do |event_hash|
    events << MatchEvent.new(match_id.to_i, event_hash)
  end

  events
end