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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/giant-bomber.rb +15 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01f5ce078fe12224e8fdba40bd9d24375a5160a6
4
- data.tar.gz: e7ac536e42b3d198e9e89a315d904213c541ff0e
3
+ metadata.gz: 42596d5bd4063d9a0e0f9db8208bdb3733fbe3e1
4
+ data.tar.gz: a4588038e659653f4ae1c078c3d7f6918bb999dc
5
5
  SHA512:
6
- metadata.gz: 20ffed698c92577ab267393dc477960ebc0bdfe9448e226ac7e30ee6a97b49b2947c2ba3eaa72c02661e03d63c05b4cc9817334dfaf400a6ffd5ff6eb753ae39
7
- data.tar.gz: eb650a7814615074b79e41fd8e554bc32157ea42b77dc9bed491518be8288d2d43b0e27a44c5985b277c2a6ad1a6eed727b9e1e9eb34b81f860de1fdea048f21
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(platform_name)
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: giant-bomber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Byrd