Class: Fifa::Metal
- Inherits:
-
Object
- Object
- Fifa::Metal
- Defined in:
- lib/fifadat/api.rb
Class Method Summary collapse
-
.competition_url(idCompetition:) ⇒ Object
note - singular (NOT plural).
- .live_url(idCompetition:, idSeason:, idStage:, idMatch:) ⇒ Object
- .matches_url(idSeason:) ⇒ Object
-
.season_url(idSeason:) ⇒ Object
note - singular (NOT plural).
-
.seasons_url(idCompetition:) ⇒ Object
list_seasons List a competition's seasons/editions (e.g. each World Cup year), newest first, with start and end dates.
- .squads_url(idSeason:, idCompetition:) ⇒ Object
- .stages_url(idSeason:) ⇒ Object
- .timeline_url(idCompetition:, idSeason:, idStage:, idMatch:) ⇒ Object
Class Method Details
.competition_url(idCompetition:) ⇒ Object
note - singular (NOT plural)
55 56 57 |
# File 'lib/fifadat/api.rb', line 55 def self.competition_url( idCompetition: ) ## note - singular (NOT plural) "#{BASE_URL}/competitions/#{idCompetition}?language=en" end |
.live_url(idCompetition:, idSeason:, idStage:, idMatch:) ⇒ Object
99 100 101 102 |
# File 'lib/fifadat/api.rb', line 99 def self.live_url( idCompetition:, idSeason:, idStage:, idMatch: ) "#{BASE_URL}/live/football/#{idCompetition}/#{idSeason}/#{idStage}/#{idMatch}?language=en" end |
.matches_url(idSeason:) ⇒ Object
82 83 84 85 86 87 88 |
# File 'lib/fifadat/api.rb', line 82 def self.matches_url( idSeason: ) ## note - may add &idCompetition=17 "#{BASE_URL}/calendar/matches?"+ "count=500&idSeason=#{idSeason}" + "&language=en" end |
.season_url(idSeason:) ⇒ Object
note - singular (NOT plural)
59 60 61 62 |
# File 'lib/fifadat/api.rb', line 59 def self.season_url( idSeason: ) ## note - singular (NOT plural) ## API_ROOT/seasons/278491 "#{BASE_URL}/seasons/#{idSeason}" end |
.seasons_url(idCompetition:) ⇒ Object
list_seasons List a competition's seasons/editions (e.g. each World Cup year), newest first, with start and end dates. Takes an idCompetition; returns the idSeason that stage, fixture, and squad lookups need.
69 70 71 72 73 |
# File 'lib/fifadat/api.rb', line 69 def self.seasons_url( idCompetition: ) "#{BASE_URL}/seasons?"+ "count=500&idCompetition=#{idCompetition}" + "&language=en" end |
.squads_url(idSeason:, idCompetition:) ⇒ Object
77 78 79 80 |
# File 'lib/fifadat/api.rb', line 77 def self.squads_url( idSeason:, idCompetition: ) ## API_ROOT/teams/squads/all/108/278491 "#{BASE_URL}/teams/squads/all/#{idCompetition}/#{idSeason}" end |
.stages_url(idSeason:) ⇒ Object
90 91 92 93 94 95 |
# File 'lib/fifadat/api.rb', line 90 def self.stages_url( idSeason: ) ## note - may add &idCompetition=17 "#{BASE_URL}/stages?idSeason=#{idSeason}" + "&language=en" end |
.timeline_url(idCompetition:, idSeason:, idStage:, idMatch:) ⇒ Object
104 105 106 107 108 |
# File 'lib/fifadat/api.rb', line 104 def self.timeline_url( idCompetition:, idSeason:, idStage:, idMatch: ) #API_ROOT/timelines/108/278491/278493/300424860?language=en-GB "#{BASE_URL}/timelines/#{idCompetition}/#{idSeason}/#{idStage}/#{idMatch}?language=en" end |