Class: TflApi::Client::Cabwise

Inherits:
Object
  • Object
show all
Defined in:
lib/tfl_api_client/cabwise.rb

Overview

This class communicates with the TFL “/Cabwise” API to obtain details about taxis and minicabs contact information.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Cabwise

Initialize the Cabwise object and store the reference to Client object

Parameters:

  • client (Client)

    the client object



40
41
42
# File 'lib/tfl_api_client/cabwise.rb', line 40

def initialize(client)
  @client = client
end

Instance Method Details

#search(latitude, longitude, params = {}) ⇒ Hash

Returns all contact information for taxis and minicabs known by the TFL service within based upon the given search query.

Parameters:

  • latitude (String)

    the latitude value

  • longitude (String)

    the longitude value

  • params (String) (defaults to: {})

    Additional search query values

Returns:

  • (Hash)

    A hash of operator information



53
54
55
# File 'lib/tfl_api_client/cabwise.rb', line 53

def search(latitude, longitude, params={})
  @client.get('/Cabwise/search', params.merge({ lat: latitude, lon: longitude }))
end