lib/bnet/diablo3/item.rb in bnet-0.0.3 vs lib/bnet/diablo3/item.rb in bnet-0.0.4
- old
+ new
@@ -1,3 +1,11 @@
-class Bnet::Diablo3::Item
+class Bnet::Diablo3::Item < Bnet::BnetResource
attr_accessor :item_id, :location, :name
+
+ 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
end