wowapi 0.1.6 → 0.1.7
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 +4 -4
- data/lib/wowapi/modules/character.rb +2 -16
- data/lib/wowapi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6da1c60e116e338396abea0df004517db1b7e0a3
|
4
|
+
data.tar.gz: f900c1b8293a45cf8fb538473e5a9198a34531c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78c0244721234e024466186fd9a1fa081fad02796e356e43ffd1878ac34baaefecff82e55b0c48ab3944064b12dfa2a2d46b0a1e8f90292833d0524665b164b2
|
7
|
+
data.tar.gz: 56a3cca13169315261a0b89f0228c6d123e025b701fd342c3c03abe01b065aa7482863111292ce9e2567e355eb674f870179906f51c1637857ac8aa6da01c2a6
|
@@ -5,24 +5,10 @@ class Wowapi
|
|
5
5
|
module Character
|
6
6
|
# todo: issue-13
|
7
7
|
class CharacterClass < Wowapi::ResponseData
|
8
|
-
def initialize(res)
|
9
|
-
super
|
10
|
-
|
11
|
-
# Likely requires refactoring. This reassigns unsufficient thumbnail address
|
12
|
-
# returned by World of Warcraft API and sets it to proper thumbnail URL
|
13
|
-
# that you can use to download / display image from Blizzards' servers
|
14
|
-
if @table
|
15
|
-
if @table.key?(:character) && @table[:character].key?('thumbnail')
|
16
|
-
@table[:character]['thumbnail'] = "http://render-api-#{Wowapi.region}.worldofwarcraft.com/static-render/#{Wowapi.region}/#{@table[:character]['thumbnail']}"
|
17
|
-
elsif @table.key?(:thumbnail)
|
18
|
-
@table[:thumbnail] = "http://render-api-#{Wowapi.region}.worldofwarcraft.com/static-render/#{Wowapi.region}/#{@table[:thumbnail]}"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
8
|
## Character avatar image
|
24
9
|
def avatar
|
25
|
-
@table[:character]['thumbnail']
|
10
|
+
_url = @table[:character]['thumbnail'] || @table[:thumbnail]
|
11
|
+
_url ? ("http://render-api-#{Wowapi.region}.worldofwarcraft.com/static-render/#{Wowapi.region}/#{_url}") : (nil)
|
26
12
|
end
|
27
13
|
end
|
28
14
|
|
data/lib/wowapi/version.rb
CHANGED