Class: TflApi::Client::Cycle
- Inherits:
-
Object
- Object
- TflApi::Client::Cycle
- Defined in:
- lib/tfl_api_client/cycle.rb
Overview
This class communicates with the TFL “/CycleSuperhighway” API to obtain details about the cycle superhighways based upon their IDs.
Instance Method Summary collapse
-
#initialize(client) ⇒ Cycle
constructor
Initialize the Cycle object and store the reference to Client object.
-
#superhighway(id) ⇒ hash
Returns the all details known by the TFL service for the given Cycle Superhighway id.
-
#superhighways ⇒ Array
Returns all Cycle Superhighway locations known by the TFL service.
Constructor Details
#initialize(client) ⇒ Cycle
Initialize the Cycle object and store the reference to Client object
40 41 42 |
# File 'lib/tfl_api_client/cycle.rb', line 40 def initialize(client) @client = client end |
Instance Method Details
#superhighway(id) ⇒ hash
Returns the all details known by the TFL service for the given Cycle Superhighway id.
60 61 62 |
# File 'lib/tfl_api_client/cycle.rb', line 60 def superhighway(id) @client.get("/CycleSuperhighway/#{id}") end |
#superhighways ⇒ Array
Returns all Cycle Superhighway locations known by the TFL service
49 50 51 |
# File 'lib/tfl_api_client/cycle.rb', line 49 def superhighways @client.get('/CycleSuperhighway') end |