Class: Wowr::Classes::SearchItem

Inherits:
Item
  • Object
show all
Defined in:
lib/wowr/classes.rb

Overview

A really basic item type returned by searches

Instance Attribute Summary collapse

Attributes inherited from Item

#icon, #id, #name

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ SearchItem

Returns a new instance of SearchItem.



972
973
974
975
976
977
978
979
980
# File 'lib/wowr/classes.rb', line 972

def initialize(elem)
  super(elem)
  @rarity      = elem[:rarity].to_i
  @url       = elem[:url]

  @item_level  = elem.at("filter[@name='itemLevel']")[:value].to_i
  @source      = elem.at("filter[@name='source']")[:value]
  @relevance = elem.at("filter[@name='relevance']")[:value].to_i
end

Instance Attribute Details

#item_levelObject (readonly) Also known as: level

Returns the value of attribute item_level.



968
969
970
# File 'lib/wowr/classes.rb', line 968

def item_level
  @item_level
end

#rarityObject (readonly)

Returns the value of attribute rarity.



968
969
970
# File 'lib/wowr/classes.rb', line 968

def rarity
  @rarity
end

#relevanceObject (readonly)

Returns the value of attribute relevance.



968
969
970
# File 'lib/wowr/classes.rb', line 968

def relevance
  @relevance
end

#sourceObject (readonly)

Returns the value of attribute source.



968
969
970
# File 'lib/wowr/classes.rb', line 968

def source
  @source
end

#urlObject (readonly)

Returns the value of attribute url.



968
969
970
# File 'lib/wowr/classes.rb', line 968

def url
  @url
end