Class: Bnet::Diablo3::Item

Inherits:
BnetResource show all
Defined in:
lib/bnet/diablo3/item.rb

Constant Summary

Constants inherited from BnetResource

BnetResource::PARAMS_MAPPING

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from BnetResource

#initialize

Constructor Details

This class inherits a constructor from Bnet::BnetResource

Instance Attribute Details

#item_idObject

Returns the value of attribute item_id.



2
3
4
# File 'lib/bnet/diablo3/item.rb', line 2

def item_id
  @item_id
end

#locationObject

Returns the value of attribute location.



2
3
4
# File 'lib/bnet/diablo3/item.rb', line 2

def location
  @location
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/bnet/diablo3/item.rb', line 2

def name
  @name
end

Class Method Details

.from_api(location, raw_response) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/bnet/diablo3/item.rb', line 4

def self.from_api(location, raw_response)
  item = new(location: location)
  item.item_id = raw_response["id"]
  item.name = raw_response["name"]

  return item
end