Class: FootStats::Live
- Defined in:
- lib/foot_stats/live.rb,
lib/foot_stats/live_card.rb,
lib/foot_stats/live_goal.rb,
lib/foot_stats/live_team.rb,
lib/foot_stats/live_player.rb
Defined Under Namespace
Classes: Card, Goal, Player, Team
Constant Summary collapse
- MAPPED_PARAMS =
{ source_id: '@IdPartida', score: '@Placar', penalty_score: '@PlacarPenaltis', date: '@Data', period: '@Periodo', referee: '@Arbitro', stadium: '@Estadio', city: '@Cidade', country: '@Pais', has_narration: '@TemNarracao', round: '@Rodada', phase: '@Fase', cup: '@Taca', group: '@Grupo', home_team: 'Mandante', visitor_team: 'Visitante' }
Class Method Summary collapse
-
.find(match_id, options = {}) ⇒ Live
Retrieve live data of a match.
-
.resource_key ⇒ String
Return the resource key that is fetch from the API response.
-
.resource_name ⇒ String
Return the resource name to request to FootStats.
Instance Method Summary collapse
- #home_penalty_score ⇒ Object
- #home_score ⇒ Object
- #visitor_penalty_score ⇒ Object
- #visitor_score ⇒ Object
Methods inherited from Resource
Methods included from AttributeAccessor
Constructor Details
This class inherits a constructor from FootStats::Resource
Class Method Details
.find(match_id, options = {}) ⇒ Live
Retrieve live data of a match
54 55 56 57 58 59 |
# File 'lib/foot_stats/live.rb', line 54 def find(match_id, ={}) response = Request.new(self, :IdPartida => match_id).parse stream_key: 'live_match' return response.error if response.error? updated_response response, end |
.resource_key ⇒ String
Return the resource key that is fetch from the API response.
73 74 75 |
# File 'lib/foot_stats/live.rb', line 73 def resource_key nil end |
.resource_name ⇒ String
Return the resource name to request to FootStats.
65 66 67 |
# File 'lib/foot_stats/live.rb', line 65 def resource_name 'AoVivo' end |
Instance Method Details
#home_penalty_score ⇒ Object
39 40 41 |
# File 'lib/foot_stats/live.rb', line 39 def home_penalty_score penalty_score[:home] end |
#home_score ⇒ Object
31 32 33 |
# File 'lib/foot_stats/live.rb', line 31 def home_score score[:home] end |
#visitor_penalty_score ⇒ Object
43 44 45 |
# File 'lib/foot_stats/live.rb', line 43 def visitor_penalty_score penalty_score[:visitor] end |
#visitor_score ⇒ Object
35 36 37 |
# File 'lib/foot_stats/live.rb', line 35 def visitor_score score[:visitor] end |