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.
- checksums.yaml +13 -5
- data/lib/hearthstone_json.rb +21 -15
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NmU1ZGQ4MDJlN2U5Y2M2NDZkYWZhOGNiYjNhYWYxMDQ5YWFmYTRhNg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MjE2ZTljNjMwMTE3NWE5OTMwNzBlMjI0NmUwZmYxZDIxYjIwNGIwNg==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZmQyZjkwMDQzOGQ5OGIzZGUyMDc2NGJiOGIwMmU4ZGU5OWZmMGExN2I5NmY2
|
10
|
+
ZGU0MGJmMTZmOGM0ZGFlZGNiMjBiMDljZWJjOTU1ZDc2NjVmOWM0MmFhM2Yz
|
11
|
+
YjQzY2JkYzBlYWEyOGM2OGMzMzEyNjBiNzZmMmZmNzFlYWUwODE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
M2EyY2RiNWIwYTJmOWQzYjUxMGJmY2Q2OGNmOTYzZDAzYjkxZTM2YzZjMmY5
|
14
|
+
ZWIzMDZjYjYyYmM0NjBmY2Y4ZmM2OWZkZmQ4ZDZlZjQxM2NlZDM5NDMwODNi
|
15
|
+
ZGE1YmYxN2Q5YzExOWI0YzM0MTA1NDM1ZGI3OTdjNzNjNTI4ZjY=
|
data/lib/hearthstone_json.rb
CHANGED
@@ -1,25 +1,31 @@
|
|
1
1
|
require 'httparty'
|
2
2
|
|
3
|
+
# HearthstoneJSON Class
|
3
4
|
class HearthstoneJSON
|
4
|
-
|
5
|
+
include HTTParty
|
5
6
|
|
6
|
-
|
7
|
-
|
7
|
+
API_URL_BASE = 'https://api.hearthstonejson.com'.freeze
|
8
|
+
API_VER = 'v1'.freeze
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
19
|
-
JSON.parse(HTTParty.get("#{API_URL_BASE}/#{API_VER}/enums.json", options).body)
|
20
|
-
end
|
23
|
+
private
|
21
24
|
|
22
|
-
|
25
|
+
attr_accessor :locale
|
23
26
|
|
24
|
-
|
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.
|
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.
|
40
|
+
rubygems_version: 2.4.5
|
41
41
|
signing_key:
|
42
42
|
specification_version: 4
|
43
43
|
summary: Ruby gem for hearthstonejson.com
|