lib/octobat/api_resource.rb in octobat-0.0.12 vs lib/octobat/api_resource.rb in octobat-2.0.0

- old
+ new

@@ -21,11 +21,14 @@ def refresh response, api_key = Octobat.request(:get, url, @api_key, @retrieve_options) refresh_from(response, api_key) end - def self.retrieve(id, api_key=nil) - instance = self.new(id, api_key) + def self.retrieve(id, opts={}) + api_key, headers = Util.parse_opts(opts) + opts[:api_key] ||= @api_key + + instance = self.new(id, opts) instance.refresh instance end end end