football_api 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/football_api/base_request.rb +1 -1
- data/lib/football_api/match.rb +13 -3
- data/lib/football_api/mixins/symbolizer.rb +1 -1
- data/lib/football_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13b8c69cc770246caab805f50882509599ae5118
|
4
|
+
data.tar.gz: d1f8e0191399bed5dea6af6e90f2479e861aa973
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 356d5eda47d2ff3d2005e206d8527fed382cbb45b5a9a28ba72729fbb71f824acf0185572f99d41055b91258a4af0817544636865970c3e4e457657672fa0dd9
|
7
|
+
data.tar.gz: 4645b4c4d4c3347582e4c44fd59dae3de05bc65b1fc405bfc74d76307f8497806a3bc0452cd844c1b61b09278713610a67a095c0c4790bac1a940819bf1b66a1
|
data/lib/football_api/match.rb
CHANGED
@@ -3,12 +3,17 @@ module FootballApi
|
|
3
3
|
include FootballApi::Requestable
|
4
4
|
|
5
5
|
api_options action: :today,
|
6
|
-
|
7
|
-
|
6
|
+
action_params: :match_params,
|
7
|
+
json_key: :matches
|
8
8
|
|
9
9
|
class << self
|
10
10
|
attr_accessor :competition_id
|
11
11
|
|
12
|
+
def today
|
13
|
+
@competition_id = nil
|
14
|
+
Array(response).map { |match| new(match) }
|
15
|
+
end
|
16
|
+
|
12
17
|
def all_from_competition(competition)
|
13
18
|
@competition_id = competition.is_a?(Competition) ? competition.id : competition
|
14
19
|
|
@@ -16,7 +21,7 @@ module FootballApi
|
|
16
21
|
end
|
17
22
|
|
18
23
|
def match_params
|
19
|
-
{ comp_id: self.competition_id}
|
24
|
+
self.competition_id ? { comp_id: self.competition_id} : {}
|
20
25
|
end
|
21
26
|
end
|
22
27
|
|
@@ -54,6 +59,11 @@ module FootballApi
|
|
54
59
|
@match_venue_beta = hash[:match_venue_beta]
|
55
60
|
@match_venue_id_beta = hash[:match_venue_id_beta]
|
56
61
|
@match_venue_city_beta = hash[:match_venue_city_beta]
|
62
|
+
@match_events = parse_match_events(hash[:match_events])
|
63
|
+
end
|
64
|
+
|
65
|
+
def parse_match_events(arr = [])
|
66
|
+
Array(arr).map { |e| FootballApi::Event.new(e) }
|
57
67
|
end
|
58
68
|
end
|
59
69
|
end
|
data/lib/football_api/version.rb
CHANGED