Class: Statium::Opta::Resource::LiveMatch

Inherits:
CommonResource show all
Defined in:
lib/statium/opta/resource/live_match.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CommonResource

#build_uri, #common_url_options

Constructor Details

#initialize(tournament_calendar_uuid, page_number = 1, page_size = 500) ⇒ LiveMatch

Returns a new instance of LiveMatch



7
8
9
10
11
# File 'lib/statium/opta/resource/live_match.rb', line 7

def initialize(tournament_calendar_uuid, page_number = 1, page_size = 500)
  @tournament_calendar_uuid = tournament_calendar_uuid
  @page_number = page_number
  @page_size = page_size
end

Instance Attribute Details

#tournament_calendar_uuidObject

Returns the value of attribute tournament_calendar_uuid



5
6
7
# File 'lib/statium/opta/resource/live_match.rb', line 5

def tournament_calendar_uuid
  @tournament_calendar_uuid
end

Class Method Details

.parse(response_body) ⇒ Object



28
29
30
# File 'lib/statium/opta/resource/live_match.rb', line 28

def self.parse response_body
  Statium::Opta::Model::Match.build response_body
end

Instance Method Details

#parse(response_body) ⇒ Object



24
25
26
# File 'lib/statium/opta/resource/live_match.rb', line 24

def parse response_body
  self.class.parse response_body
end

#uri(auth_key, lang = 'en') ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/statium/opta/resource/live_match.rb', line 13

def uri(auth_key, lang = 'en')
  specific_options = {
    tmcl: @tournament_calendar_uuid,
    live: 'yes',
    lineups: 'yes',
    status: 'playing',
    _pgSz: @page_size,
  }
  build_uri('match', auth_key, nil, common_url_options(lang).merge(specific_options))
end