battle_pet 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/battle_pet/ability.rb +12 -7
  2. metadata +2 -2
@@ -1,11 +1,16 @@
1
1
  class BattlePet::Ability
2
- attr_accessor :id, :name, :type, :cooldown, :rounds
2
+ attr_accessor :id, :name, :icon ,:type, :cooldown, :rounds
3
3
 
4
- def initialize(params)
5
- @id = params["id"]
6
- @name = params["name"]
7
- @type = BattlePet::Type.find(params["petTypeId"])
8
- @cooldown = params["cooldown"]
9
- @rounds = params["rounds"]
4
+ def initialize(data)
5
+ @id = data["id"]
6
+ @name = data["name"]
7
+ @icon = data["icon"]
8
+ @type = BattlePet::Type.find(data["petTypeId"])
9
+ @cooldown = data["cooldown"]
10
+ @rounds = data["rounds"]
11
+ end
12
+
13
+ def icon_url
14
+ "http://media.blizzard.com/wow/icons/56/#{icon}.jpg"
10
15
  end
11
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: battle_pet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-06 00:00:00.000000000 Z
12
+ date: 2013-06-13 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A simple gem to get data from WoW BattlePet API
15
15
  email: zwt315@163.com