Class: SoccersApi::Game

Inherits:
Object
  • Object
show all
Defined in:
lib/soccers_api/game.rb

Constant Summary collapse

GAME =
'fixtures'.freeze

Class Method Summary collapse

Class Method Details

.bench(id) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/soccers_api/game.rb', line 25

def bench(id)
  SoccersApi.api_url(
    api_for: GAME,
    type: "match_bench",
    id_type: 'id',
    id: id
  )
end

.by_date(date) ⇒ Object



61
62
63
64
65
66
67
68
# File 'lib/soccers_api/game.rb', line 61

def by_date(date)
  SoccersApi.api_url(
    api_for: GAME,
    type: "schedule",
    id_type: 'd',
    id: data.strftime("%F")
  )
end

.by_date_and_country(data:, country_id:) ⇒ Object



70
71
72
73
74
75
76
77
78
79
# File 'lib/soccers_api/game.rb', line 70

def by_date_and_country(data:, country_id:)
  SoccersApi.api_url(
    api_for: GAME,
    type: "schedule",
    id_type: 'd',
    id: data.strftime("%F"),
    id_type_two: 'country_id',
    id_two:country_id
  )
end

.by_date_and_league(data:, league_id:) ⇒ Object



81
82
83
84
85
86
87
88
89
90
# File 'lib/soccers_api/game.rb', line 81

def by_date_and_league(data:, league_id:)
  SoccersApi.api_url(
    api_for: GAME,
    type: "schedule",
    id_type: 'd',
    id: data.strftime("%F"),
    id_type_two: 'league_id',
    id_two:league_id
  )
end

.by_date_and_season(data:, season_id:) ⇒ Object



92
93
94
95
96
97
98
99
100
101
# File 'lib/soccers_api/game.rb', line 92

def by_date_and_season(data:, season_id:)
  SoccersApi.api_url(
    api_for: GAME,
    type: "schedule",
    id_type: 'd',
    id: data.strftime("%F"),
    id_type_two: 'season_id',
    id_two:season_id
  )
end

.by_id(id) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/soccers_api/game.rb', line 7

def by_id(id)
  SoccersApi.api_url(
    api_for: GAME,
    type: "info",
    id_type: 'id',
    id: id
  )
end

.by_round(round_id) ⇒ Object



123
124
125
126
127
128
129
130
# File 'lib/soccers_api/game.rb', line 123

def by_round(round_id)
  SoccersApi.api_url(
    api_for: GAME,
    type: "round",
    id_type: 'round_id',
    id: round_id
  )
end

.by_round_and_team(team_id:, round_id:) ⇒ Object



132
133
134
135
136
137
138
139
140
141
# File 'lib/soccers_api/game.rb', line 132

def by_round_and_team(team_id:, round_id:)
  SoccersApi.api_url(
    api_for: GAME,
    type: "round",
    id_type: 'round_id',
    id: round_id,
    id_type_two: 'team_id',
    id_two:team_id
  )
end

.by_season(season_id) ⇒ Object



103
104
105
106
107
108
109
110
# File 'lib/soccers_api/game.rb', line 103

def by_season(season_id)
  SoccersApi.api_url(
    api_for: GAME,
    type: "season",
    id_type: 'season_id',
    id: season_id
  )
end

.by_season_and_team(team_id:, season_id:) ⇒ Object



112
113
114
115
116
117
118
119
120
121
# File 'lib/soccers_api/game.rb', line 112

def by_season_and_team(team_id:, season_id:)
  SoccersApi.api_url(
    api_for: GAME,
    type: "season",
    id_type: 'season_id',
    id: season_id,
    id_type_two: 'team_id',
    id_two:team_id
  )
end

.commentary(id) ⇒ Object



43
44
45
46
47
48
49
50
# File 'lib/soccers_api/game.rb', line 43

def commentary(id)
  SoccersApi.api_url(
    api_for: GAME,
    type: "match_comments",
    id_type: 'id',
    id: id
  )
end

.events(id) ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/soccers_api/game.rb', line 34

def events(id)
  SoccersApi.api_url(
    api_for: GAME,
    type: "match_events",
    id_type: 'id',
    id: id
  )
end

.lineups(id) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/soccers_api/game.rb', line 16

def lineups(id)
  SoccersApi.api_url(
    api_for: GAME,
    type: "match_lineups",
    id_type: 'id',
    id: id
  )
end

.trend_analysis(id) ⇒ Object



52
53
54
55
56
57
58
59
# File 'lib/soccers_api/game.rb', line 52

def trend_analysis(id)
  SoccersApi.api_url(
    api_for: GAME,
    type: "match_trends",
    id_type: 'id',
    id: id
  )
end