lib/strava/web/client.rb in strava-ruby-client-0.2.0 vs lib/strava/web/client.rb in strava-ruby-client-0.3.0
- old
+ new
@@ -8,11 +8,11 @@
def initialize(options = {})
Strava::Web::Config::ATTRIBUTES.each do |key|
send("#{key}=", options[key] || Strava::Web.config.send(key))
end
- @logger ||= Strava::Logger.default
+ @logger ||= Strava::Logger.logger
end
def endpoint
raise NotImplementedError
end
@@ -22,9 +22,19 @@
block_given? ? yield(Config) : Config
end
def config
Config
+ end
+ end
+
+ def parse_args(id_or_options, options = {})
+ if id_or_options.is_a?(Hash)
+ throw ArgumentError.new('Required argument :id missing') if id_or_options[:id].nil?
+ [id_or_options[:id], id_or_options.except(:id)]
+ else
+ throw ArgumentError.new('Required argument :id missing') if id_or_options.nil?
+ [id_or_options, options]
end
end
end
end
end