Class: Strava::Web::Client
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Request
#delete, #get, #post, #put
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
Class Method Details
.config ⇒ Object
25
26
27
|
# File 'lib/strava/web/client.rb', line 25
def config
Config
end
|
21
22
23
|
# File 'lib/strava/web/client.rb', line 21
def configure
block_given? ? yield(Config) : Config
end
|
Instance Method Details
#endpoint ⇒ Object
16
17
18
|
# File 'lib/strava/web/client.rb', line 16
def endpoint
raise NotImplementedError
end
|
#parse_args(id_or_options, options = {}) ⇒ Object
30
31
32
33
34
35
36
37
38
|
# File 'lib/strava/web/client.rb', line 30
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
|