Class: Gares::Base
- Inherits:
-
Hashie::Mash
- Object
- Hashie::Mash
- Gares::Base
- Defined in:
- lib/gares/base.rb
Overview
Represents a station on gares-sncf.com
Direct Known Subclasses
Constant Summary collapse
- OPEN_DATA_SNCF =
"https://ressources.data.sncf.com/api/records/1.0/search?dataset=referentiel-gares-voyageurs&q=%s"- GARES_SNCF =
"http://www.gares-sncf.com/fr/train-times/%s/%s/gl"
Instance Method Summary collapse
-
#arrivals(refresh = false) ⇒ Array<Train>
(also: #arriving_trains)
List of the next arriving trains in this station.
-
#departures(refresh = false) ⇒ Array<Train>
(also: #departing_trains)
List of the next departing trains from this station.
-
#has_borne? ⇒ Boolean
Whether this station has a “borne” (yellow self-service ticket machine).
- #lat ⇒ Object deprecated Deprecated.
- #long ⇒ Object deprecated Deprecated.
- #slug ⇒ Object deprecated Deprecated.
Instance Method Details
#arrivals(refresh = false) ⇒ Array<Train> Also known as: arriving_trains
List of the next arriving trains in this station.
46 47 48 49 50 |
# File 'lib/gares/base.rb', line 46 def arrivals(refresh = false) if tvs trains(:arrival, refresh) end end |
#departures(refresh = false) ⇒ Array<Train> Also known as: departing_trains
List of the next departing trains from this station.
36 37 38 39 40 |
# File 'lib/gares/base.rb', line 36 def departures(refresh = false) if tvs trains(:departure, refresh) end end |
#has_borne? ⇒ Boolean
Whether this station has a “borne” (yellow self-service ticket machine)
11 12 13 |
# File 'lib/gares/base.rb', line 11 def has_borne? sncf_self_service_machine == "t" end |
#lat ⇒ Object
Deprecated.
22 23 24 25 |
# File 'lib/gares/base.rb', line 22 def lat warn "[DEPRECATION] favor the 'latitude' method instead of 'lat'." latitude end |
#long ⇒ Object
Deprecated.
28 29 30 31 |
# File 'lib/gares/base.rb', line 28 def long warn "[DEPRECATION] favor the 'longitude' method instead of 'long'." longitude end |
#slug ⇒ Object
Deprecated.
16 17 18 19 |
# File 'lib/gares/base.rb', line 16 def slug warn "[DEPRECATION] favor the 'sncf_id' method instead of 'slug'." sncf_id.downcase end |