Class: GoTransit::Stop
- Inherits:
-
ApiResource
- Object
- ApiResource
- GoTransit::Stop
- Defined in:
- lib/go_transit/resources/stop.rb
Defined Under Namespace
Classes: Destination, Facility, Line, NextService, Parking, Place, Station
Instance Attribute Summary collapse
-
#boarding_info ⇒ Object
Returns the value of attribute boarding_info.
-
#boarding_info_fr ⇒ Object
Returns the value of attribute boarding_info_fr.
-
#city ⇒ Object
Returns the value of attribute city.
-
#code ⇒ Object
Returns the value of attribute code.
-
#driving_directions ⇒ Object
Returns the value of attribute driving_directions.
-
#driving_directions_fr ⇒ Object
Returns the value of attribute driving_directions_fr.
-
#facilities ⇒ Object
Returns the value of attribute facilities.
-
#intersection ⇒ Object
Returns the value of attribute intersection.
-
#is_bus ⇒ Object
Returns the value of attribute is_bus.
-
#is_train ⇒ Object
Returns the value of attribute is_train.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#lines ⇒ Object
Returns the value of attribute lines.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#name ⇒ Object
Returns the value of attribute name.
-
#parkings ⇒ Object
Returns the value of attribute parkings.
-
#place ⇒ Object
Returns the value of attribute place.
-
#stations ⇒ Object
Returns the value of attribute stations.
-
#stop_name ⇒ Object
Returns the value of attribute stop_name.
-
#stop_name_fr ⇒ Object
Returns the value of attribute stop_name_fr.
-
#street_name ⇒ Object
Returns the value of attribute street_name.
-
#street_number ⇒ Object
Returns the value of attribute street_number.
-
#ticket_sales ⇒ Object
Returns the value of attribute ticket_sales.
-
#ticket_sales_fr ⇒ Object
Returns the value of attribute ticket_sales_fr.
-
#zone_code ⇒ Object
Returns the value of attribute zone_code.
Class Method Summary collapse
- .all ⇒ Object
- .destinations(stop_code:, from_time:, to_time:) ⇒ Object
- .details(stop_code:) ⇒ Object
- .next_service(stop_code:) ⇒ Object
Instance Method Summary collapse
Methods inherited from ApiResource
Constructor Details
This class inherits a constructor from GoTransit::ApiResource
Instance Attribute Details
#boarding_info ⇒ Object
Returns the value of attribute boarding_info.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def boarding_info @boarding_info end |
#boarding_info_fr ⇒ Object
Returns the value of attribute boarding_info_fr.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def boarding_info_fr @boarding_info_fr end |
#city ⇒ Object
Returns the value of attribute city.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def city @city end |
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def code @code end |
#driving_directions ⇒ Object
Returns the value of attribute driving_directions.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def driving_directions @driving_directions end |
#driving_directions_fr ⇒ Object
Returns the value of attribute driving_directions_fr.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def driving_directions_fr @driving_directions_fr end |
#facilities ⇒ Object
Returns the value of attribute facilities.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def facilities @facilities end |
#intersection ⇒ Object
Returns the value of attribute intersection.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def intersection @intersection end |
#is_bus ⇒ Object
Returns the value of attribute is_bus.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def is_bus @is_bus end |
#is_train ⇒ Object
Returns the value of attribute is_train.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def is_train @is_train end |
#latitude ⇒ Object
Returns the value of attribute latitude.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def latitude @latitude end |
#lines ⇒ Object
Returns the value of attribute lines.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def lines @lines end |
#longitude ⇒ Object
Returns the value of attribute longitude.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def longitude @longitude end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def name @name end |
#parkings ⇒ Object
Returns the value of attribute parkings.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def parkings @parkings end |
#place ⇒ Object
Returns the value of attribute place.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def place @place end |
#stations ⇒ Object
Returns the value of attribute stations.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def stations @stations end |
#stop_name ⇒ Object
Returns the value of attribute stop_name.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def stop_name @stop_name end |
#stop_name_fr ⇒ Object
Returns the value of attribute stop_name_fr.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def stop_name_fr @stop_name_fr end |
#street_name ⇒ Object
Returns the value of attribute street_name.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def street_name @street_name end |
#street_number ⇒ Object
Returns the value of attribute street_number.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def street_number @street_number end |
#ticket_sales ⇒ Object
Returns the value of attribute ticket_sales.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def ticket_sales @ticket_sales end |
#ticket_sales_fr ⇒ Object
Returns the value of attribute ticket_sales_fr.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def ticket_sales_fr @ticket_sales_fr end |
#zone_code ⇒ Object
Returns the value of attribute zone_code.
3 4 5 |
# File 'lib/go_transit/resources/stop.rb', line 3 def zone_code @zone_code end |
Class Method Details
.all ⇒ Object
9 10 11 12 13 |
# File 'lib/go_transit/resources/stop.rb', line 9 def self.all client = Client.new response = client.get("Stop/All") new(response.data).stations end |
.destinations(stop_code:, from_time:, to_time:) ⇒ Object
27 28 29 30 31 |
# File 'lib/go_transit/resources/stop.rb', line 27 def self.destinations(stop_code:, from_time:, to_time:) client = Client.new response = client.get("Stop/Destinations/#{stop_code}/#{from_time}/#{to_time}") Stop::Destination.new(response.data) end |
.details(stop_code:) ⇒ Object
15 16 17 18 19 |
# File 'lib/go_transit/resources/stop.rb', line 15 def self.details(stop_code:) client = Client.new response = client.get("Stop/Details/#{stop_code}") new(response.data) end |
.next_service(stop_code:) ⇒ Object
21 22 23 24 25 |
# File 'lib/go_transit/resources/stop.rb', line 21 def self.next_service(stop_code:) client = Client.new response = client.get("Stop/NextService/#{stop_code}") Stop::NextService.new(response.data) end |
Instance Method Details
#bus? ⇒ Boolean
33 34 35 |
# File 'lib/go_transit/resources/stop.rb', line 33 def bus? is_bus.to_i.positive? end |
#train? ⇒ Boolean
37 38 39 |
# File 'lib/go_transit/resources/stop.rb', line 37 def train? is_train.to_i.positive? end |