decathlon-sports 0.1.6 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/decathlon/sports/sport.rb +13 -25
- data/lib/decathlon/sports/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4c629b9376d93e6a375ffe8c2720090b2243d582b77ad72b805b267707e37ad
|
4
|
+
data.tar.gz: cda252fa54b05f826ba1fa693e77b9c6d60d5260d3acec166940c1a398a392b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3fa2cf26356ef14b024f69216c4bd0d99367fd009115018908b2be81aefacf58f25d4f0722f3a8a057777d86db935cc876f8313264ae11fe4b219fe280e86aa
|
7
|
+
data.tar.gz: aa06e029ead6da2e737e2b50bf3f6f08b01c280d930f5e6cc5d4836d50845ec43ecff1cc922eedf136df49fd7bf07c63ec2f9882e8bb6bb8147cd0f6d3385530
|
data/Gemfile.lock
CHANGED
@@ -5,45 +5,33 @@ API_URL = 'https://sports.api.decathlon.com'.freeze
|
|
5
5
|
|
6
6
|
module Decathlon
|
7
7
|
module Sports
|
8
|
-
def self.
|
9
|
-
|
8
|
+
def self.call(url: API_URL, params: {}, headers: {})
|
9
|
+
response = Faraday.get(url, params, headers)
|
10
|
+
JSON.parse(response.body)
|
10
11
|
end
|
11
12
|
|
12
|
-
def self.
|
13
|
-
call
|
13
|
+
def self.all(url: "#{API_URL}/sports", params: {}, headers: {})
|
14
|
+
call(url: url, params: params, headers: headers)
|
14
15
|
end
|
15
16
|
|
16
|
-
def self.
|
17
|
-
|
18
|
-
JSON.parse(response.body)
|
17
|
+
def self.find(id, params: {}, headers: {})
|
18
|
+
call(url: "#{API_URL}/sports/#{id}", params: params, headers: headers)
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.
|
22
|
-
|
23
|
-
JSON.parse(response.body)
|
21
|
+
def self.search(query, params: {}, headers: {})
|
22
|
+
call(url: "#{API_URL}/sports?q=#{query}", params: params, headers: headers)
|
24
23
|
end
|
25
24
|
|
26
|
-
def self.
|
27
|
-
|
28
|
-
JSON.parse(response.body)
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.filter(**args)
|
32
|
-
response = Faraday.get do |req|
|
33
|
-
req.url "#{API_URL}/sports"
|
34
|
-
req.params['tag'] = args[:tag] if args[:tag]
|
35
|
-
req.params['decathlon_id'] = args[:decathlon_id] if args[:decathlon_id]
|
36
|
-
req.params['parents_only'] = args[:parents_only] if args[:parents_only]
|
37
|
-
end
|
38
|
-
JSON.parse(response.body)
|
25
|
+
def self.isearch(query, params: {}, headers: {})
|
26
|
+
call(url: "#{API_URL}/sports/search/#{query}", params: params, headers: headers)
|
39
27
|
end
|
40
28
|
|
41
29
|
def groups
|
42
|
-
call "#{API_URL}/groups"
|
30
|
+
call(url: "#{API_URL}/groups")
|
43
31
|
end
|
44
32
|
|
45
33
|
def group(id)
|
46
|
-
call "#{API_URL}/groups/#{id}"
|
34
|
+
call(url: "#{API_URL}/groups/#{id}")
|
47
35
|
end
|
48
36
|
end
|
49
37
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decathlon-sports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Decathlon Canada
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-08-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|