wowapi 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40f58251088f0c504e35e57d005aeb01b4971dd9
4
- data.tar.gz: 6c31a0b62e357cdaf9a13593eda7aa6d6f532084
3
+ metadata.gz: f40906e45284a1fa4b162688bc7b8c56d6b30eee
4
+ data.tar.gz: 59b75311856e31fc1d3786210795cdb00d53f8a5
5
5
  SHA512:
6
- metadata.gz: eee91355e730b0cfcf7b743e9e0993e62c30fa26481065b4c9a174a2e0c0fc6de7d4566b19af99fd233718fe315d5884e7f81fae09d4e50e697c903dd7ae13e8
7
- data.tar.gz: 913c286c5a2cc034b5cbbcffa3f59ce9cae96230cca87ca86b2938ffde0e3b14ff0d87e1efdeb35c9d5029490940ba3c6335d146556f2193bc9e41c62d3e55ae
6
+ metadata.gz: 2e969fb9c44416d079d25c443d616c172ec29f35c296139a0a490fc9022a970474d964ee5870fcb75a8e7cbabb5edf6e2a2e14fa894a5574c3600eea40d962ac
7
+ data.tar.gz: 7beb47805b96e9b348d4688ca53b471e20a56b8eed55cc04f4a5f6e2624c16e54f6ef9f9bf07aa8b8b7d74e18b57ae43db882949257a22812cc2f1dca00b2719
@@ -1,3 +1,5 @@
1
+ require 'json'
2
+
1
3
  class Wowapi
2
4
  # Every ModuleClass inherits from this object,
3
5
  # so GuildClass, AchievementClass etc.
@@ -16,11 +18,16 @@ class Wowapi
16
18
  super
17
19
  end
18
20
 
19
- # Override default .to_json method
20
- # this one returns raw data that was assigned
21
- # during initialization
21
+ # Return raw data (retrieved by Blizzard servers)
22
22
  def to_json
23
- @raw
23
+ @raw.to_json
24
+ end
25
+
26
+ # Create a object of suitable class e.g.:
27
+ # guild = api.guild ...
28
+ # guild = guild.from_json(data)
29
+ def from_json(data)
30
+ self.class.new(JSON.parse(data))
24
31
  end
25
32
  end
26
33
  end
@@ -1,4 +1,4 @@
1
1
  class Wowapi
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wowapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Matusz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-17 00:00:00.000000000 Z
11
+ date: 2016-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry