giant-bomber 0.0.1 → 0.0.3
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/giant-bomber.rb +15 -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: 42596d5bd4063d9a0e0f9db8208bdb3733fbe3e1
|
4
|
+
data.tar.gz: a4588038e659653f4ae1c078c3d7f6918bb999dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cd8ebe2cd5d512812acf0cbb89a025b4be1046f7526fc1ffe42f1389ff0f81bb2b1e8ad0ec0661663cd6f2a4f840c6b19b0d8dca15e3806ffc09c4c3c822ee9
|
7
|
+
data.tar.gz: c1fa7123fb7122fd545212633b663b22152a7a644670e5caa084295357999c03d60c86a1a57f3ae7ca3bf86bb5aa00d8eaac2fd063464a23b3ae3dcb9c262786
|
data/lib/giant-bomber.rb
CHANGED
@@ -23,6 +23,10 @@ class Agent
|
|
23
23
|
self.class.get("/platforms/?api_key=#{@key}&format=json&field_list=name,id")["results"]
|
24
24
|
end
|
25
25
|
|
26
|
+
def second_platforms
|
27
|
+
self.class.get("/platforms/?api_key=#{@key}&format=json&field_list=name,id&offset=100")["results"]
|
28
|
+
end
|
29
|
+
|
26
30
|
#Search for info about a platform, based on its name
|
27
31
|
def platform(id)
|
28
32
|
self.class.get("/platform/#{id}/?api_key=#{@key}&format=json&field_list=name,description,deck,release_date,image")["results"]
|
@@ -39,8 +43,18 @@ class Agent
|
|
39
43
|
platform_hash
|
40
44
|
end
|
41
45
|
|
46
|
+
def platform_id_hash2
|
47
|
+
list = second_platforms
|
48
|
+
platform_hash = Hash.new
|
49
|
+
list.each do |platform|
|
50
|
+
platform_hash[platform["name"]] = platform["id"]
|
51
|
+
end
|
52
|
+
|
53
|
+
platform_hash
|
54
|
+
end
|
55
|
+
|
42
56
|
#get the 20 most popular games from the platform of choice
|
43
|
-
def platform_games(
|
57
|
+
def platform_games(platform_id)
|
44
58
|
self.class.get("/games/?api_key=#{@key}&format=json&platforms=#{platform_id.to_i}&field_list=name,deck,image,id,original_release_date&sort=number_of_user_reviews:desc&limit=20")["results"]
|
45
59
|
end
|
46
60
|
|