Class: TflApi::Client::Journey
- Inherits:
-
Object
- Object
- TflApi::Client::Journey
- Defined in:
- lib/tfl_api_client/journey.rb
Overview
This class communicates with the TFL “/Journey” API to obtain details about taxis and minicabs contact information.
Instance Method Summary collapse
-
#initialize(client) ⇒ Journey
constructor
Initialize the Journey object and store the reference to Client object.
-
#modes ⇒ Array
Gets a list of all of the available journey planner modes.
-
#planner(from, to, params = {}) ⇒ Hash
Perform a Journey Planner search from the parameters specified in simple types.
Constructor Details
#initialize(client) ⇒ Journey
Initialize the Journey object and store the reference to Client object
39 40 41 |
# File 'lib/tfl_api_client/journey.rb', line 39 def initialize(client) @client = client end |
Instance Method Details
#modes ⇒ Array
Gets a list of all of the available journey planner modes.
47 48 49 |
# File 'lib/tfl_api_client/journey.rb', line 47 def modes @client.get('/Journey/Meta/Modes') end |
#planner(from, to, params = {}) ⇒ Hash
Perform a Journey Planner search from the parameters specified in simple types.
59 60 61 |
# File 'lib/tfl_api_client/journey.rb', line 59 def planner(from, to, params={}) @client.get("/Journey/JourneyResults/#{from}/to/#{to}", params) end |