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) ⇒ SearchItem
constructor
A new instance of SearchItem.
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_level ⇒ Object (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 |
#rarity ⇒ Object (readonly)
Returns the value of attribute rarity.
968 969 970 |
# File 'lib/wowr/classes.rb', line 968 def rarity @rarity end |
#relevance ⇒ Object (readonly)
Returns the value of attribute relevance.
968 969 970 |
# File 'lib/wowr/classes.rb', line 968 def relevance @relevance end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
968 969 970 |
# File 'lib/wowr/classes.rb', line 968 def source @source end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
968 969 970 |
# File 'lib/wowr/classes.rb', line 968 def url @url end |