Class: Bnet::Diablo3::Follower
- Inherits:
-
BnetResource
- Object
- BnetResource
- Bnet::Diablo3::Follower
- Defined in:
- lib/bnet/diablo3/follower.rb
Constant Summary
Constants inherited from BnetResource
Instance Attribute Summary collapse
-
#experience_bonus ⇒ Object
Returns the value of attribute experience_bonus.
-
#follower_type ⇒ Object
Returns the value of attribute follower_type.
-
#gold_find ⇒ Object
Returns the value of attribute gold_find.
-
#items ⇒ Object
Returns the value of attribute items.
-
#level ⇒ Object
Returns the value of attribute level.
-
#magic_find ⇒ Object
Returns the value of attribute magic_find.
-
#raw_attributes ⇒ Object
Returns the value of attribute raw_attributes.
-
#skills ⇒ Object
Returns the value of attribute skills.
Class Method Summary collapse
Methods inherited from BnetResource
Constructor Details
This class inherits a constructor from Bnet::BnetResource
Instance Attribute Details
#experience_bonus ⇒ Object
Returns the value of attribute experience_bonus.
2 3 4 |
# File 'lib/bnet/diablo3/follower.rb', line 2 def experience_bonus @experience_bonus end |
#follower_type ⇒ Object
Returns the value of attribute follower_type.
2 3 4 |
# File 'lib/bnet/diablo3/follower.rb', line 2 def follower_type @follower_type end |
#gold_find ⇒ Object
Returns the value of attribute gold_find.
2 3 4 |
# File 'lib/bnet/diablo3/follower.rb', line 2 def gold_find @gold_find end |
#items ⇒ Object
Returns the value of attribute items.
2 3 4 |
# File 'lib/bnet/diablo3/follower.rb', line 2 def items @items end |
#level ⇒ Object
Returns the value of attribute level.
2 3 4 |
# File 'lib/bnet/diablo3/follower.rb', line 2 def level @level end |
#magic_find ⇒ Object
Returns the value of attribute magic_find.
2 3 4 |
# File 'lib/bnet/diablo3/follower.rb', line 2 def magic_find @magic_find end |
#raw_attributes ⇒ Object
Returns the value of attribute raw_attributes.
2 3 4 |
# File 'lib/bnet/diablo3/follower.rb', line 2 def raw_attributes @raw_attributes end |
#skills ⇒ Object
Returns the value of attribute skills.
2 3 4 |
# File 'lib/bnet/diablo3/follower.rb', line 2 def skills @skills end |
Class Method Details
.from_api(follower_type, raw_response) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bnet/diablo3/follower.rb', line 8 def self.from_api(follower_type, raw_response) follower = new(follower_type: follower_type) follower.raw_attributes = raw_response follower.level = raw_response["level"] assign_items_from_raw_items(follower, raw_response["items"]) if raw_response["items"] assign_skills_from_raw_skills(follower, raw_response["skills"]) if raw_response["skills"] follower.magic_find = raw_response["stats"]["magicFind"] follower.gold_find = raw_response["stats"]["goldFind"] follower.experience_bonus = raw_response["stats"]["experienceBonus"] return follower end |