class KiwiApi::HttpService

Public Class Methods

new() click to toggle source
# File lib/kiwi_api/http_service.rb, line 5
def initialize
  @api_key = KiwiApi.api_key
end

Public Instance Methods

connection() click to toggle source
# File lib/kiwi_api/http_service.rb, line 9
def connection
  @connection ||= begin
    Faraday.new(url: "https://kiwicom-prod.apigee.net") do |faraday|
      faraday.adapter Faraday.default_adapter
      faraday.headers["apikey"] = @api_key
    end
  end
end
request_get(url, params) click to toggle source
# File lib/kiwi_api/http_service.rb, line 18
def request_get(url, params)
  connection.get do |req|
    req.url url
    req.params = params
  end
end