hearthstone_json 0.0.2 → 0.0.6

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 +13 -5
  2. data/lib/hearthstone_json.rb +21 -15
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 6d586a999f2bcd87eec5c838385bd6eaa470c055
4
- data.tar.gz: d72787d05ee3b1afb7cb87774802d3e9720bda4b
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NmU1ZGQ4MDJlN2U5Y2M2NDZkYWZhOGNiYjNhYWYxMDQ5YWFmYTRhNg==
5
+ data.tar.gz: !binary |-
6
+ MjE2ZTljNjMwMTE3NWE5OTMwNzBlMjI0NmUwZmYxZDIxYjIwNGIwNg==
5
7
  SHA512:
6
- metadata.gz: a7d8f82952c1dcae9ab1be6ba70769ce75249159c77df1e699f60731752cf911aecdccf2ca6843be143c34a3e9ccaa4db0a72f3480b5d0986e5c015019da018b
7
- data.tar.gz: 1cd9ea60f3baf965faa6a3543bd333e70159866d2d50cf252887d6a5bdebc7386c65c9c1f6f0e98fb3d9cc6bda231bbc005e3017d8fe8ceade1058a9f5987a05
8
+ metadata.gz: !binary |-
9
+ ZmQyZjkwMDQzOGQ5OGIzZGUyMDc2NGJiOGIwMmU4ZGU5OWZmMGExN2I5NmY2
10
+ ZGU0MGJmMTZmOGM0ZGFlZGNiMjBiMDljZWJjOTU1ZDc2NjVmOWM0MmFhM2Yz
11
+ YjQzY2JkYzBlYWEyOGM2OGMzMzEyNjBiNzZmMmZmNzFlYWUwODE=
12
+ data.tar.gz: !binary |-
13
+ M2EyY2RiNWIwYTJmOWQzYjUxMGJmY2Q2OGNmOTYzZDAzYjkxZTM2YzZjMmY5
14
+ ZWIzMDZjYjYyYmM0NjBmY2Y4ZmM2OWZkZmQ4ZDZlZjQxM2NlZDM5NDMwODNi
15
+ ZGE1YmYxN2Q5YzExOWI0YzM0MTA1NDM1ZGI3OTdjNzNjNTI4ZjY=
@@ -1,25 +1,31 @@
1
1
  require 'httparty'
2
2
 
3
+ # HearthstoneJSON Class
3
4
  class HearthstoneJSON
4
- include HTTParty
5
+ include HTTParty
5
6
 
6
- API_URL_BASE = 'https://api.hearthstonejson.com'.freeze
7
- API_VER = 'v1'.freeze
7
+ API_URL_BASE = 'https://api.hearthstonejson.com'.freeze
8
+ API_VER = 'v1'.freeze
8
9
 
9
- def initialize(data_ver = 'latest', locale = 'enUS')
10
- self.class.base_uri "#{API_URL_BASE}/#{API_VER}/#{data_ver}/#{locale}"
11
- end
10
+ def initialize(data_ver = 'latest', locale = 'enUS')
11
+ self.class.base_uri "#{API_URL_BASE}/#{API_VER}/#{data_ver}/#{locale}"
12
+ end
12
13
 
13
- def self.get_json(_path, _options = {})
14
- response = self.class.get(URI.escape(path), options)
15
- JSON.parse(response.body)
16
- end
14
+ def enums(options = {})
15
+ JSON.parse(
16
+ HTTParty.get(
17
+ URI.escape("#{API_URL_BASE}/#{API_VER}/enums.json"),
18
+ options
19
+ ).body
20
+ )
21
+ end
17
22
 
18
- def enums(options = {})
19
- JSON.parse(HTTParty.get("#{API_URL_BASE}/#{API_VER}/enums.json", options).body)
20
- end
23
+ private
21
24
 
22
- private
25
+ attr_accessor :locale
23
26
 
24
- attr_accessor :locale
27
+ def get_json(path, options = {})
28
+ response = self.class.get(URI.escape(path), options)
29
+ JSON.parse(response.body)
30
+ end
25
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hearthstone_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Hanna
@@ -27,17 +27,17 @@ require_paths:
27
27
  - lib
28
28
  required_ruby_version: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - ">="
30
+ - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
32
  version: '0'
33
33
  required_rubygems_version: !ruby/object:Gem::Requirement
34
34
  requirements:
35
- - - ">="
35
+ - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
37
  version: '0'
38
38
  requirements: []
39
39
  rubyforge_project:
40
- rubygems_version: 2.6.4
40
+ rubygems_version: 2.4.5
41
41
  signing_key:
42
42
  specification_version: 4
43
43
  summary: Ruby gem for hearthstonejson.com