Class: Myxy::Client
Instance Method Summary
collapse
Methods included from Request
#delete, #get, #post, #put
Constructor Details
#initialize(options = {}) ⇒ Client
11
12
13
14
15
16
|
# File 'lib/myxy/client.rb', line 11
def initialize(options = {})
options = Myxy.options.merge(options)
Config::VALID_OPTIONS_KEYS.each do |key|
send("#{key}=", options[key])
end
end
|
Instance Method Details
#config ⇒ Object
29
30
31
32
33
34
35
|
# File 'lib/myxy/client.rb', line 29
def config
conf = {}
Config::VALID_OPTIONS_KEYS.each do |key|
conf[key] = send key
end
conf
end
|
#connection ⇒ Object
18
19
20
21
22
23
|
# File 'lib/myxy/client.rb', line 18
def connection
Faraday.new(url) do |faraday|
faraday.adapter Faraday.default_adapter
faraday.port = 443
end
end
|
#url ⇒ Object
25
26
27
|
# File 'lib/myxy/client.rb', line 25
def url
URI.join(base_url, version)
end
|