Class: WarcraftArmory::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/warcraft_armory/base.rb

Overview

The Base class provides general purpose methods to access the Armory

Class Method Summary collapse

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. :eu or :us

  • realm - A symbol specifying your realm. E.g. :aszune or :bloodhoof

  • character - A symbol specifying the character. E.g. :adries or :dwaria

  • file - Optionally specifies the XML file to retrieve. Defauls to character-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