battle_pet 0.1.3 → 0.1.4
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.
- data/README.md +9 -9
- data/Rakefile +8 -0
- data/lib/battle_pet.rb +61 -61
- data/lib/battle_pet.yml +1995 -1995
- data/lib/pet_ability.rb +11 -11
- data/lib/pet_type.rb +16 -16
- data/test/data/mechanical_squirrel_cn.json +1 -0
- data/test/data/mechanical_squirrel_us.json +1 -0
- data/test/test_battle_pet.rb +8 -0
- metadata +6 -2
data/lib/pet_ability.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
class PetAbility
|
2
|
-
attr_accessor :id, :name, :type, :cooldown, :rounds
|
3
|
-
|
4
|
-
def initialize(params)
|
5
|
-
@id = params["id"]
|
6
|
-
@name = params["name"]
|
7
|
-
@type = PetType.find(params["petTypeId"])
|
8
|
-
@cooldown = params["cooldown"]
|
9
|
-
@rounds = params["rounds"]
|
10
|
-
end
|
11
|
-
end
|
1
|
+
class PetAbility
|
2
|
+
attr_accessor :id, :name, :type, :cooldown, :rounds
|
3
|
+
|
4
|
+
def initialize(params)
|
5
|
+
@id = params["id"]
|
6
|
+
@name = params["name"]
|
7
|
+
@type = PetType.find(params["petTypeId"])
|
8
|
+
@cooldown = params["cooldown"]
|
9
|
+
@rounds = params["rounds"]
|
10
|
+
end
|
11
|
+
end
|
data/lib/pet_type.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
class PetType
|
2
|
-
PET_TYPES = { 0 => 'Humanoid',
|
3
|
-
1 => 'Dragonkin',
|
4
|
-
2 => 'Flying',
|
5
|
-
3 => 'Undead',
|
6
|
-
4 => 'Critter',
|
7
|
-
5 => 'Magical',
|
8
|
-
6 => 'Elemental',
|
9
|
-
7 => 'Beast',
|
10
|
-
8 => 'Aquatic',
|
11
|
-
9 => 'Mechanical' }
|
12
|
-
|
13
|
-
def self.find(type_id)
|
14
|
-
PET_TYPES[type_id]
|
15
|
-
end
|
16
|
-
end
|
1
|
+
class PetType
|
2
|
+
PET_TYPES = { 0 => 'Humanoid',
|
3
|
+
1 => 'Dragonkin',
|
4
|
+
2 => 'Flying',
|
5
|
+
3 => 'Undead',
|
6
|
+
4 => 'Critter',
|
7
|
+
5 => 'Magical',
|
8
|
+
6 => 'Elemental',
|
9
|
+
7 => 'Beast',
|
10
|
+
8 => 'Aquatic',
|
11
|
+
9 => 'Mechanical' }
|
12
|
+
|
13
|
+
def self.find(type_id)
|
14
|
+
PET_TYPES[type_id]
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
{"speciesId":39,"petTypeId":9,"creatureId":2671,"canBattle":true,"icon":"inv_pet_mechanicalsquirrel","description":"��е�������ڵ����������ĸ�������Ҫ���ɼ��������˨���Ա�����ȡ�á�","source":"רҵ���ܣ�����","abilities":[{"slot":2,"order":2,"requiredLevel":4,"id":459,"name":"��������","icon":"inv_gizmo_02","cooldown":0,"rounds":1,"petTypeId":9,"isPassive":false,"hideHints":false},{"slot":0,"order":3,"requiredLevel":10,"id":202,"name":"ʹ��","icon":"spell_druid_thrash","cooldown":0,"rounds":1,"petTypeId":7,"isPassive":false,"hideHints":false},{"slot":0,"order":0,"requiredLevel":1,"id":384,"name":"��ȭ","icon":"inv_misc_desecrated_plategloves","cooldown":0,"rounds":1,"petTypeId":9,"isPassive":false,"hideHints":false},{"slot":1,"order":1,"requiredLevel":2,"id":389,"name":"��Ƶ","icon":"inv_gizmo_03","cooldown":0,"rounds":1,"petTypeId":9,"isPassive":false,"hideHints":false},{"slot":2,"order":5,"requiredLevel":20,"id":278,"name":"��","icon":"ability_repair","cooldown":5,"rounds":3,"petTypeId":9,"isPassive":false,"hideHints":true},{"slot":1,"order":4,"requiredLevel":15,"id":392,"name":"ǿ������","icon":"inv_misc_wartornscrap_plate","cooldown":4,"rounds":1,"petTypeId":9,"isPassive":false,"hideHints":true}]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"speciesId":39,"petTypeId":9,"creatureId":2671,"canBattle":true,"icon":"inv_pet_mechanicalsquirrel","description":"A mechanical squirrel's logic center tells it to collect and store both nuts and bolts for the winter.","source":"Profession: Engineering","abilities":[{"slot":2,"order":2,"requiredLevel":4,"id":459,"name":"Wind-Up","icon":"inv_gizmo_02","cooldown":0,"rounds":1,"petTypeId":9,"isPassive":false,"hideHints":false},{"slot":0,"order":3,"requiredLevel":10,"id":202,"name":"Thrash","icon":"spell_druid_thrash","cooldown":0,"rounds":1,"petTypeId":7,"isPassive":false,"hideHints":false},{"slot":0,"order":0,"requiredLevel":1,"id":384,"name":"Metal Fist","icon":"inv_misc_desecrated_plategloves","cooldown":0,"rounds":1,"petTypeId":9,"isPassive":false,"hideHints":false},{"slot":1,"order":1,"requiredLevel":2,"id":389,"name":"Overtune","icon":"inv_gizmo_03","cooldown":0,"rounds":1,"petTypeId":9,"isPassive":false,"hideHints":false},{"slot":2,"order":5,"requiredLevel":20,"id":278,"name":"Repair","icon":"ability_repair","cooldown":5,"rounds":3,"petTypeId":9,"isPassive":false,"hideHints":true},{"slot":1,"order":4,"requiredLevel":15,"id":392,"name":"Extra Plating","icon":"inv_misc_wartornscrap_plate","cooldown":4,"rounds":1,"petTypeId":9,"isPassive":false,"hideHints":true}]}
|
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.1.
|
4
|
+
version: 0.1.4
|
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-05-
|
12
|
+
date: 2013-05-29 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
|
@@ -21,7 +21,11 @@ files:
|
|
21
21
|
- lib/battle_pet.yml
|
22
22
|
- lib/pet_ability.rb
|
23
23
|
- lib/pet_type.rb
|
24
|
+
- test/data/mechanical_squirrel_cn.json
|
25
|
+
- test/data/mechanical_squirrel_us.json
|
26
|
+
- test/test_battle_pet.rb
|
24
27
|
- README.md
|
28
|
+
- Rakefile
|
25
29
|
homepage: https://github.com/hegwin/battle_pet
|
26
30
|
licenses: []
|
27
31
|
post_install_message:
|