hearthstone_json 0.0.2
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 +7 -0
- data/lib/hearthstone_json.rb +25 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6d586a999f2bcd87eec5c838385bd6eaa470c055
|
4
|
+
data.tar.gz: d72787d05ee3b1afb7cb87774802d3e9720bda4b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a7d8f82952c1dcae9ab1be6ba70769ce75249159c77df1e699f60731752cf911aecdccf2ca6843be143c34a3e9ccaa4db0a72f3480b5d0986e5c015019da018b
|
7
|
+
data.tar.gz: 1cd9ea60f3baf965faa6a3543bd333e70159866d2d50cf252887d6a5bdebc7386c65c9c1f6f0e98fb3d9cc6bda231bbc005e3017d8fe8ceade1058a9f5987a05
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
|
3
|
+
class HearthstoneJSON
|
4
|
+
include HTTParty
|
5
|
+
|
6
|
+
API_URL_BASE = 'https://api.hearthstonejson.com'.freeze
|
7
|
+
API_VER = 'v1'.freeze
|
8
|
+
|
9
|
+
def initialize(data_ver = 'latest', locale = 'enUS')
|
10
|
+
self.class.base_uri "#{API_URL_BASE}/#{API_VER}/#{data_ver}/#{locale}"
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.get_json(_path, _options = {})
|
14
|
+
response = self.class.get(URI.escape(path), options)
|
15
|
+
JSON.parse(response.body)
|
16
|
+
end
|
17
|
+
|
18
|
+
def enums(options = {})
|
19
|
+
JSON.parse(HTTParty.get("#{API_URL_BASE}/#{API_VER}/enums.json", options).body)
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
attr_accessor :locale
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hearthstone_json
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alex Hanna
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-07-24 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Ruby gem for easily getting up to date info from hearthstonejson.com
|
14
|
+
email: tinnvec@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/hearthstone_json.rb
|
20
|
+
homepage: https://github.com/tinnvec/hearthstone_json
|
21
|
+
licenses:
|
22
|
+
- MIT
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.6.4
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: Ruby gem for hearthstonejson.com
|
44
|
+
test_files: []
|