Class: TflApi::Client::Mode
- Inherits:
-
Object
- Object
- TflApi::Client::Mode
- Defined in:
- lib/tfl_api_client/mode.rb
Overview
This class communicates with the TFL “/Journey” API to obtain details about taxis and minicabs contact information.
Instance Method Summary collapse
-
#active_service_types ⇒ Array
Returns the service type active for a mode.
-
#initialize(client) ⇒ Mode
constructor
Initialize the Mode object and store the reference to Client object.
-
#next_arrival(mode, count = -1)) ⇒ Array
Returns the next arrival predictions for all stops of a given mode.
Constructor Details
#initialize(client) ⇒ Mode
Initialize the Mode object and store the reference to Client object
39 40 41 |
# File 'lib/tfl_api_client/mode.rb', line 39 def initialize(client) @client = client end |
Instance Method Details
#active_service_types ⇒ Array
Returns the service type active for a mode.
47 48 49 |
# File 'lib/tfl_api_client/mode.rb', line 47 def active_service_types @client.get('/Mode/ActiveServiceTypes') end |
#next_arrival(mode, count = -1)) ⇒ Array
Returns the next arrival predictions for all stops of a given mode
58 59 60 |
# File 'lib/tfl_api_client/mode.rb', line 58 def next_arrival(mode, count = -1) @client.get("/Mode/#{mode}/Arrivals", { count: count }) end |