Class: Wowr::Classes::SearchItem
Overview
A really basic item type returned by searches
Instance Attribute Summary collapse
-
#item_level ⇒ Object
(also: #level)
readonly
Returns the value of attribute item_level.
-
#rarity ⇒ Object
readonly
Returns the value of attribute rarity.
-
#relevance ⇒ Object
readonly
Returns the value of attribute relevance.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Attributes inherited from Item
Instance Method Summary collapse
-
#initialize(elem, api = nil) ⇒ SearchItem
constructor
A new instance of SearchItem.
Methods inherited from Item
Constructor Details
#initialize(elem, api = nil) ⇒ SearchItem
Returns a new instance of SearchItem.
401 402 403 404 405 406 407 408 409 |
# File 'lib/wowr/item.rb', line 401 def initialize(elem, api = nil) super(elem, api) @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_level ⇒ Object (readonly) Also known as: level
Returns the value of attribute item_level.
397 398 399 |
# File 'lib/wowr/item.rb', line 397 def item_level @item_level end |
#rarity ⇒ Object (readonly)
Returns the value of attribute rarity.
397 398 399 |
# File 'lib/wowr/item.rb', line 397 def rarity @rarity end |
#relevance ⇒ Object (readonly)
Returns the value of attribute relevance.
397 398 399 |
# File 'lib/wowr/item.rb', line 397 def relevance @relevance end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
397 398 399 |
# File 'lib/wowr/item.rb', line 397 def source @source end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
397 398 399 |
# File 'lib/wowr/item.rb', line 397 def url @url end |