Class: Wowr::Classes::SearchItem

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

Overview

A really basic item type returned by searches

Instance Attribute Summary collapse

Attributes inherited from Item

#icon_base, #id, #name

Instance Method Summary collapse

Methods inherited from Item

#icon

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_levelObject (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

#rarityObject (readonly)

Returns the value of attribute rarity.



397
398
399
# File 'lib/wowr/item.rb', line 397

def rarity
  @rarity
end

#relevanceObject (readonly)

Returns the value of attribute relevance.



397
398
399
# File 'lib/wowr/item.rb', line 397

def relevance
  @relevance
end

#sourceObject (readonly)

Returns the value of attribute source.



397
398
399
# File 'lib/wowr/item.rb', line 397

def source
  @source
end

#urlObject (readonly)

Returns the value of attribute url.



397
398
399
# File 'lib/wowr/item.rb', line 397

def url
  @url
end