Class: WarcraftArmory::Base
- Inherits:
-
Object
- Object
- WarcraftArmory::Base
- Defined in:
- lib/warcraft_armory/base.rb
Overview
The Base class provides general purpose methods to access the Armory
Class Method Summary collapse
-
.generate_url(location, realm, character, file = 'character-sheet.xml') ⇒ Object
Generates a URL to the Armory.
Class Method Details
.generate_url(location, realm, character, file = 'character-sheet.xml') ⇒ Object
Generates a URL to the Armory.
Usage
-
location- A symbol specifying your realm’s location. E.g.:euor:us -
realm- A symbol specifying your realm. E.g.:aszuneor:bloodhoof -
character- A symbol specifying the character. E.g.:adriesor:dwaria -
file- Optionally specifies the XML file to retrieve. Defauls tocharacter-sheet.xml
Examples
WarcraftArmory::Base.generate_url(:eu, :aszune, :adries)
# => http://eu.wowarmory.com/character-sheet.xml?r=Aszune&n=Adries
WarcraftArmory::Base.generate_url(:us, :nazgrel, :gorgious, 'character-talents.xml')
# => http://us.wowarmory.com/character-talents.xml?r=Nazgrel&n=Gorgious
20 21 22 |
# File 'lib/warcraft_armory/base.rb', line 20 def self.generate_url(location, realm, character, file = 'character-sheet.xml') "http://#{location.to_s}.wowarmory.com/#{file.to_s}?r=#{realm.to_s}&n=#{character.to_s}" end |