lib/mwo/mech.rb in mwo-0.1.1 vs lib/mwo/mech.rb in mwo-0.1.2

- old
+ new

@@ -1,19 +1,16 @@ class MWO::Mech < OpenStruct extend MWO::Utils - # def initialize args = {} - # args.each do |k,v| - # instance_variable_set("@#{k}", v) unless v.nil? - # end - # end + def self.all_raw(overrides: {}) + client = MWO::Client.new(overrides: {}) + fetch(client.mechs_url) + end def self.all - client = MWO::Client.new(overrides: {}) - raw = fetch(client.mechs_url) mechs = [] - raw["Mechs"].each do |name, attrs| + all_raw["Mechs"].each do |name, attrs| # Remove the loadout from the index. attrs.delete('Loadout') # The mech classification value is broken in the API