Class: Wowheadr::Entity::Spell

Inherits:
Object
  • Object
show all
Includes:
Support::EntityMethodMapper, URI::Rel
Defined in:
lib/wowheadr/entity/spell.rb

Overview

Wowheadr::Entity::Spell represents a rel entry in an HTML link tag to specify details about the spell being linked to. A list of key/value combinations can be found at www.wowhead.com/tooltips#related-advanced-usage

Instance Method Summary collapse

Methods included from Support::EntityMethodMapper

included

Methods included from URI::Rel

#domain, #to_s

Constructor Details

#initialize(id = nil) ⇒ Spell

Create a new Spell and optionally pass in the ID, which automatically calls #spell on the new object.



16
17
18
19
20
21
22
# File 'lib/wowheadr/entity/spell.rb', line 16

def initialize(id = nil)
  super()
  unless id.nil?
    self.spell(id)
  end
  self
end

Instance Method Details

#buff(buff) ⇒ Object

Whether or not to show the tooltip for the buff the spell provides, rather than for the spell itself.



39
40
41
# File 'lib/wowheadr/entity/spell.rb', line 39

def buff(buff)
  self.set(:buff, buff)
end

#level(level) ⇒ Object Also known as: lvl

Set the character’s level, useful for spell scaling.



32
33
34
# File 'lib/wowheadr/entity/spell.rb', line 32

def level(level)
  self.set(:lvl, level)
end

#spell(id) ⇒ Object Also known as: id

Set the item ID for the spell. Useful if the href attribute of the link does not lead to the spell’s URL on wowhead.com (custom URLs).



26
27
28
# File 'lib/wowheadr/entity/spell.rb', line 26

def spell(id)
  self.set(:spell, id)
end