Class: SplAPI::Client
Constant Summary
collapse
- DEFAULT_ACCEPT =
'application/json'
- DEFAULT_HOST =
'http://splapi.retrorocket.biz'
- DEFAULT_USER_AGENT =
"SplAPI Ruby Gem #{SplAPI::VERSION}"
{
'Accept' => DEFAULT_ACCEPT,
'User-Agent' => DEFAULT_USER_AGENT
}
Instance Method Summary
collapse
#fes, #fes_next, #fes_next_all, #fes_now, #gachi, #gachi_next, #gachi_next_all, #gachi_now, #gachi_rules, #maps, #regular, #regular_next, #regular_next_all, #regular_now, #weapons
Instance Method Details
#connection ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/splapi/client.rb', line 17
def connection
@connection ||= Faraday.new(faraday_client_options) do |connection|
connection.request :json
connection.response :json
connection.adapter Faraday.default_adapter
end
end
|
#get(path, params = nil, headers = nil) ⇒ Object
25
26
27
|
# File 'lib/splapi/client.rb', line 25
def get(path, params = nil, = nil)
connection.send(:get, URI.escape(path), params, )
end
|