Class: KudagoClient::Connection
- Inherits:
-
Object
- Object
- KudagoClient::Connection
- Defined in:
- lib/kudago_client/connection.rb
Constant Summary collapse
- BASE_URL =
"https://kudago.com/public-api/v1.4/"
Class Method Summary collapse
Class Method Details
.connection ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/kudago_client/connection.rb', line 12 def self.connection Faraday.new() do |faraday| faraday.request :url_encoded faraday.response :json, parser_options: {decoder: Oj, symbolize_names: true} faraday.adapter Faraday.default_adapter end end |
.headers ⇒ Object
29 30 31 32 33 34 |
# File 'lib/kudago_client/connection.rb', line 29 def self.headers { "Accept" => "application/json", "User-Agent" => "Kudago Client/#{KudagoClient::VERSION}" } end |
.options ⇒ Object
22 23 24 25 26 27 |
# File 'lib/kudago_client/connection.rb', line 22 def self. { headers:, url: BASE_URL } end |