Module: Armory
- Extended by:
- Armory
- Included in:
- Armory
- Defined in:
- lib/armory.rb,
lib/armory/guild.rb,
lib/armory/version.rb,
lib/armory/character.rb
Defined Under Namespace
Classes: Character, CharacterNotFound, Error, Guild, GuildNotFound
Constant Summary collapse
- USER_AGENT =
'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.4) Gecko/20100503 Firefox/3.6.4'
- Factions =
{ 0 => "Alliance", 1 => "Horde" }
- Genders =
{ 0 => "Male", 1 => "Female" }
- Races =
{ 1 => "Human", 2 => "Orc", 3 => "Dwarf", 4 => "Night Elf", 5 => "Undead", 6 => "Tauren", 7 => "Gnome", 8 => "Troll", 10 => "Blood Elf", 11 => "Draenei" }
- Classes =
{ 1 => "Warrior", 2 => "Paladin", 3 => "Hunter", 4 => "Rogue", 5 => "Priest", 6 => "Death Knight", 7 => "Shaman", 8 => "Mage", 9 => "Warlock", 11 => "Druid" }
- VERSION =
"0.1.0"
Instance Method Summary collapse
-
#character_sheet(region, realm, character) ⇒ Object
TODO: Validate realms TODO: Handle different regions us.wowarmory.com/character-sheet.xml?r=Detheroc&n=Hunter.
- #guild_info(region, realm, guild_name) ⇒ Object
Instance Method Details
#character_sheet(region, realm, character) ⇒ Object
TODO: Validate realms TODO: Handle different regions us.wowarmory.com/character-sheet.xml?r=Detheroc&n=Hunter
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/armory.rb', line 57 def character_sheet(region, realm, character) response = make_request(region, 'character-sheet', :r => realm, :n => character) case response.code when 404 raise CharacterNotFound, "Could not find #{character} on #{region}:#{realm}" end Character.from_armory(Nokogiri::XML(response.body)) end |
#guild_info(region, realm, guild_name) ⇒ Object
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/armory.rb', line 68 def guild_info(region, realm, guild_name) response = make_request(region, 'guild-info', :r => realm, :gn => guild_name) case response.code when 404 raise GuildNotFound, "Could not find #{guild_name} on #{region}:#{realm}" end Guild.from_armory(Nokogiri::XML(response.body)) end |