Class: D3api::Item

Inherits:
BaseModel show all
Defined in:
lib/d3api/item.rb

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

Instance Method Summary collapse

Methods included from Request

#get

Methods included from Connection

#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

#attributesObject

Returns the value of attribute attributes.



14
15
16
# File 'lib/d3api/item.rb', line 14

def attributes
  @attributes
end

#bonus_affixesObject

Returns the value of attribute bonus_affixes.



14
15
16
# File 'lib/d3api/item.rb', line 14

def bonus_affixes
  @bonus_affixes
end

#display_colorObject

Returns the value of attribute display_color.



14
15
16
# File 'lib/d3api/item.rb', line 14

def display_color
  @display_color
end

#iconObject

Returns the value of attribute icon.



14
15
16
# File 'lib/d3api/item.rb', line 14

def icon
  @icon
end

#item_levelObject

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_secondObject

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_dpsObject

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_secondObject

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_dpsObject

Returns the value of attribute min_dps.



14
15
16
# File 'lib/d3api/item.rb', line 14

def min_dps
  @min_dps
end

#nameObject

Returns the value of attribute name.



14
15
16
# File 'lib/d3api/item.rb', line 14

def name
  @name
end

#required_levelObject

Returns the value of attribute required_level.



14
15
16
# File 'lib/d3api/item.rb', line 14

def required_level
  @required_level
end

#salvageObject

Returns the value of attribute salvage.



14
15
16
# File 'lib/d3api/item.rb', line 14

def salvage
  @salvage
end

#socket_effectsObject

Returns the value of attribute socket_effects.



14
15
16
# File 'lib/d3api/item.rb', line 14

def socket_effects
  @socket_effects
end

#tooltip_paramsObject

Returns the value of attribute tooltip_params.



14
15
16
# File 'lib/d3api/item.rb', line 14

def tooltip_params
  @tooltip_params
end