Class: D3api::Item
Constant Summary collapse
- ITEM_MAPPINGS =
{ :name => 'name', :icon => 'icon', :tooltip_params => 'tooltipParams', :display_color => 'displayColor', :required_level => 'requiredLevel', :item_level => 'itemLevel', :bonus_affixes => 'bonusAffixes', :attributes => 'attributes' }
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#bonus_affixes ⇒ Object
Returns the value of attribute bonus_affixes.
-
#display_color ⇒ Object
Returns the value of attribute display_color.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#item_level ⇒ Object
Returns the value of attribute item_level.
-
#max_attacks_per_second ⇒ Object
Returns the value of attribute max_attacks_per_second.
-
#max_dps ⇒ Object
Returns the value of attribute max_dps.
-
#min_attacks_per_second ⇒ Object
Returns the value of attribute min_attacks_per_second.
-
#min_dps ⇒ Object
Returns the value of attribute min_dps.
-
#name ⇒ Object
Returns the value of attribute name.
-
#required_level ⇒ Object
Returns the value of attribute required_level.
-
#salvage ⇒ Object
Returns the value of attribute salvage.
-
#socket_effects ⇒ Object
Returns the value of attribute socket_effects.
-
#tooltip_params ⇒ Object
Returns the value of attribute tooltip_params.
Instance Method Summary collapse
-
#initialize(region, item_hash) ⇒ Item
constructor
A new instance of Item.
Methods included from Request
Methods included from Connection
Constructor Details
#initialize(region, item_hash) ⇒ Item
Returns a new instance of Item.
19 20 21 22 23 24 25 26 |
# File 'lib/d3api/item.rb', line 19 def initialize(region, item_hash) json_response = find(region, item_hash) values = super json_response set_method(values, ITEM_MAPPINGS) set_item(values) end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def attributes @attributes end |
#bonus_affixes ⇒ Object
Returns the value of attribute bonus_affixes.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def bonus_affixes @bonus_affixes end |
#display_color ⇒ Object
Returns the value of attribute display_color.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def display_color @display_color end |
#icon ⇒ Object
Returns the value of attribute icon.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def icon @icon end |
#item_level ⇒ Object
Returns the value of attribute item_level.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def item_level @item_level end |
#max_attacks_per_second ⇒ Object
Returns the value of attribute max_attacks_per_second.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def max_attacks_per_second @max_attacks_per_second end |
#max_dps ⇒ Object
Returns the value of attribute max_dps.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def max_dps @max_dps end |
#min_attacks_per_second ⇒ Object
Returns the value of attribute min_attacks_per_second.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def min_attacks_per_second @min_attacks_per_second end |
#min_dps ⇒ Object
Returns the value of attribute min_dps.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def min_dps @min_dps end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def name @name end |
#required_level ⇒ Object
Returns the value of attribute required_level.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def required_level @required_level end |
#salvage ⇒ Object
Returns the value of attribute salvage.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def salvage @salvage end |
#socket_effects ⇒ Object
Returns the value of attribute socket_effects.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def socket_effects @socket_effects end |
#tooltip_params ⇒ Object
Returns the value of attribute tooltip_params.
14 15 16 |
# File 'lib/d3api/item.rb', line 14 def tooltip_params @tooltip_params end |