Class: Transprt
- Inherits:
-
Object
- Object
- Transprt
- Defined in:
- lib/transprt.rb
Class Method Summary collapse
-
.connections(parameters) ⇒ Object
> find connections.
-
.locations(parameters) ⇒ Object
> find locations.
-
.stationboard(parameters) ⇒ Object
> find station boards.
Class Method Details
.connections(parameters) ⇒ Object
> find connections
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/transprt.rb', line 27 def self.connections(parameters) allowed_parameters = ['from', 'to', 'via', 'date', 'time', 'isArrivalTime', 'transportations', 'limit', 'page', 'direct', 'sleeper', 'couchette', 'bike'] query = self.create_query(parameters, allowed_parameters) locations = JSON.parse(RestClient.get self.create_url('connections') + query) locations['connections'] end |
.locations(parameters) ⇒ Object
> find locations
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/transprt.rb', line 13 def self.locations(parameters) allowed_parameters = ['query', 'x', 'y', 'type'] query = self.create_query(parameters, allowed_parameters) locations = JSON.parse(RestClient.get self.create_url('locations') + query) locations['stations'] end |
.stationboard(parameters) ⇒ Object
> find station boards
41 42 43 44 45 46 47 48 49 |
# File 'lib/transprt.rb', line 41 def self.stationboard(parameters) allowed_parameters = ['station', 'id', 'limit', 'transportations', 'datetime'] query = self.create_query(parameters, allowed_parameters) locations = JSON.parse(RestClient.get self.create_url('stationboard') + query) locations['stationboard'] end |