Class: WoW::CharacterProfile
- Defined in:
- lib/wow/features/character_profile.rb
Constant Summary collapse
- CLASSES =
{ 1 => :warrior, 2 => :paladin, 3 => :hunter, 4 => :rogue, 5 => :priest, 6 => :death_knight, 7 => :shaman, 8 => :mage, 9 => :warlock, 10 => :monk, 11 => :druid, }
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(realm, character_name, fields = [], params = {}) ⇒ CharacterProfile
constructor
A new instance of CharacterProfile.
- #lookup(key) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(realm, character_name, fields = [], params = {}) ⇒ CharacterProfile
Returns a new instance of CharacterProfile.
19 20 21 22 |
# File 'lib/wow/features/character_profile.rb', line 19 def initialize(realm, character_name, fields = [], params = {}) params = params.merge({fields: fields.join(',')}) super(self.class.data(realm, character_name, params)) end |
Class Method Details
Instance Method Details
#lookup(key) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/wow/features/character_profile.rb', line 24 def lookup(key) case key when :class CLASSES[self[key]] else raise "No lookup mapping for #{key}" end end |