Class: KiwiApi::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/kiwi_api/client.rb

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



5
6
7
# File 'lib/kiwi_api/client.rb', line 5

def initialize
  @http_service = HttpService.new
end

Instance Method Details

#http_serviceObject



9
10
11
# File 'lib/kiwi_api/client.rb', line 9

def http_service
  @http_service
end

#location(params = {}) ⇒ Object



18
19
20
21
22
# File 'lib/kiwi_api/client.rb', line 18

def location(params = {})
  params.merge!(location_types: "airport")
  response = http_service.request_get("/locations/query", params)
  KiwiApi::Response.new(response)
end

#search(params = {}) ⇒ Object



13
14
15
16
# File 'lib/kiwi_api/client.rb', line 13

def search(params = {})
  response = http_service.request_get("/v2/search", params)
  KiwiApi::Response.new(response)
end