class TflApi::Client::Cycle

This class communicates with the TFL “/CycleSuperhighway” API to obtain details about the cycle superhighways based upon their IDs.

Public Class Methods

new(client) click to toggle source

Initialize the Cycle object and store the reference to Client object

@param client [Client] the client object

@return [Cycle] the Cycle object

# File lib/tfl_api_client/cycle.rb, line 40
def initialize(client)
  @client = client
end

Public Instance Methods

superhighway(id) click to toggle source

Returns the all details known by the TFL service for the given Cycle Superhighway id.

@param id [String] the TFL Cycle Superhighway id

@return [hash] A hash containing the details of the given Cycle Superhighway

# File lib/tfl_api_client/cycle.rb, line 60
def superhighway(id)
  @client.get("/CycleSuperhighway/#{id}")
end
superhighways() click to toggle source

Returns all Cycle Superhighway locations known by the TFL service

@return [Array] An array of hashes containing all Cycle Superhighways

and their details
# File lib/tfl_api_client/cycle.rb, line 49
def superhighways
  @client.get('/CycleSuperhighway')
end