lib/mwo/weapon.rb in mwo-0.1.1 vs lib/mwo/weapon.rb in mwo-0.1.2
- old
+ new
@@ -20,16 +20,18 @@
args.each do |k,v|
instance_variable_set("@#{k}", v) unless v.nil?
end
end
- def self.all(overrides: {})
+ def self.all_raw(overrides: {})
client = MWO::Client.new(overrides: {})
raw = fetch(client.items_url)
+ end
+ def self.all(overrides: {})
weapons = []
- raw.each do |weapon_id, attrs|
+ all_raw.each do |weapon_id, attrs|
if attrs["category"] == "weapon"
weapon = {weapon_id: weapon_id.to_i,
name: attrs["name"],
category: attrs["category"]