Class: Connexionz::Client
- Inherits:
-
Object
- Object
- Connexionz::Client
- Includes:
- Connection, Request
- Defined in:
- lib/connexionz/client.rb,
lib/connexionz/client/request.rb,
lib/connexionz/client/connection.rb
Defined Under Namespace
Modules: Connection, Request
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
-
#platform(options = {}) ⇒ Hash
Returns all platform locations (WGS84), Id’s & names.
-
#platform_group(options = {}) ⇒ Hash
Returns details platform groups where a number of platforms are grouped together under a common name.
-
#route_position_et(options = {}) ⇒ Hash
Provide ETA predictions for an individual platform or platform group.Use PlatformTag (internal key to a platform) or PlatformNo (number physically attached to a bus stop which may change from time to time) arguments.
-
#schedule_detail(servicename, options = {}) ⇒ Hash
Returns the schedule detail for the route.
-
#schedule_master(options = {}) ⇒ Hash
Returns the master list of schedules.
Methods included from Request
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 13 |
# File 'lib/connexionz/client.rb', line 8 def initialize(={}) = Connexionz..merge() Configuration::VALID_OPTIONS_KEYS.each do |key| send("#{key}=", [key]) end end |
Instance Method Details
#platform(options = {}) ⇒ Hash
Returns all platform locations (WGS84), Id’s & names.
24 25 26 |
# File 'lib/connexionz/client.rb', line 24 def platform(={}) get("rtt/public/utility/file.aspx?contenttype=SQLXML&Name=Platform.xml", ) end |
#platform_group(options = {}) ⇒ Hash
Returns details platform groups where a number of platforms are grouped together under a common name. Use PlatformTag to link to the platform locations in the above.
34 35 36 |
# File 'lib/connexionz/client.rb', line 34 def platform_group(={}) get("rtt/public/utility/file.aspx?contenttype=SQLXML&Name=PlatformGroup.xml", ) end |
#route_position_et(options = {}) ⇒ Hash
Provide ETA predictions for an individual platform or platform group.Use PlatformTag (internal key to a platform) or PlatformNo (number physically attached to a bus stop which may change from time to time) arguments.
58 59 60 |
# File 'lib/connexionz/client.rb', line 58 def route_position_et(={}) get("rtt/public/utility/file.aspx?contenttype=SQLXML&Name=RoutePositionET.xml", ) end |
#schedule_detail(servicename, options = {}) ⇒ Hash
Returns the schedule detail for the route.
81 82 83 |
# File 'lib/connexionz/client.rb', line 81 def schedule_detail(servicename, ={}) get("rtt/public/utility/file.aspx?contenttype=SQLXML&Name=ScheduleDetail.xml&ServiceName=#{servicename}", ) end |
#schedule_master(options = {}) ⇒ Hash
Returns the master list of schedules
68 69 70 |
# File 'lib/connexionz/client.rb', line 68 def schedule_master(={}) get("rtt/public/utility/file.aspx?contenttype=SQLXML&Name=ScheduleMaster.xml", ) end |