igdb2 0.8.1 → 0.8.2.pre
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/igdb/models/api_resource.rb +17 -21
- data/lib/igdb/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb7fde6302199eedb79c20d2dbecf483cf95a0ee84c7f227dc82f37ae660a7f4
|
4
|
+
data.tar.gz: '099bb1e04c8fb65202bfa1f037151193be4d8b8d9a39743e2529aebc140d215b'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91d646fcbf31985f5786088b1bdec8fd12f5335ce32c0b7d43abd0a6461af2a16583333c0d0f6cf44a5411677d686bf4a16dd40ccc798bcafda4981a7b4114f5
|
7
|
+
data.tar.gz: a5a17a47b82954dcc5f30dcd263aa5d8e3ee73496d116aa1cdc704d62bd8f6ad1ad6d0dbf97c843090f4f32e7a53df33565ed2e80e15bf4f734c47ebcdcc2220
|
@@ -14,38 +14,34 @@ module Igdb
|
|
14
14
|
Igdb::Requester.get("#{path}/meta")
|
15
15
|
end
|
16
16
|
|
17
|
-
def find(id, **
|
18
|
-
|
17
|
+
def find(id, **params)
|
18
|
+
params[:fields] ||= '*'
|
19
|
+
return find_by_slug(id, params) if id.class == String
|
19
20
|
|
20
|
-
|
21
|
-
build_collection(Igdb::Requester.get("#{path}/#{id.join(',')}", kwargs), representer)
|
22
|
-
else
|
23
|
-
build_single_resource(Igdb::Requester.get("#{path}/#{id}", kwargs)[0], representer)
|
24
|
-
end
|
21
|
+
build_single_resource(Igdb::Requester.get("#{path}/#{id}", params)[0], representer)
|
25
22
|
end
|
26
23
|
|
27
|
-
def
|
28
|
-
|
29
|
-
kwargs[:'filter[slug][eq]'] = id
|
24
|
+
def select(*ids, **params)
|
25
|
+
params[:fields] ||= '*'
|
30
26
|
|
31
|
-
|
27
|
+
build_collection(Igdb::Requester.get("#{path}/#{ids.join ','}", params), representer)
|
32
28
|
end
|
33
29
|
|
34
|
-
def
|
35
|
-
|
36
|
-
|
37
|
-
kwargs[:fields] = kwargs[:fields] || '*'
|
30
|
+
def all(**params)
|
31
|
+
params[:fields] ||= '*'
|
32
|
+
params[:limit] ||= 50
|
38
33
|
|
39
|
-
build_collection(Igdb::Requester.get("#{path}/",
|
40
|
-
end
|
41
|
-
|
42
|
-
# Alias for #search
|
43
|
-
def all(**kwargs)
|
44
|
-
search(kwargs)
|
34
|
+
build_collection(Igdb::Requester.get("#{path}/", params), representer)
|
45
35
|
end
|
46
36
|
|
47
37
|
private
|
48
38
|
|
39
|
+
def find_by_slug(slug, params)
|
40
|
+
params[:'filter[slug][eq]'] = slug
|
41
|
+
|
42
|
+
build_single_resource(Igdb::Requester.get("#{path}/", params)[0], representer)
|
43
|
+
end
|
44
|
+
|
49
45
|
def build_single_resource(response, representer)
|
50
46
|
representer.new(new).from_hash(response)
|
51
47
|
end
|
data/lib/igdb/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: igdb2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kalyn Robinson
|
@@ -266,9 +266,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
266
266
|
version: '0'
|
267
267
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
268
268
|
requirements:
|
269
|
-
- - "
|
269
|
+
- - ">"
|
270
270
|
- !ruby/object:Gem::Version
|
271
|
-
version:
|
271
|
+
version: 1.3.1
|
272
272
|
requirements: []
|
273
273
|
rubyforge_project:
|
274
274
|
rubygems_version: 2.7.3
|