Class: Gares::Base
- Inherits:
-
Hashie::Dash
- Object
- Hashie::Dash
- 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.
79 80 81 82 83 |
# File 'lib/gares/base.rb', line 79 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.
69 70 71 72 73 |
# File 'lib/gares/base.rb', line 69 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)
44 45 46 |
# File 'lib/gares/base.rb', line 44 def has_borne? has_bls == "t" end |
#lat ⇒ Object
Deprecated.
55 56 57 58 |
# File 'lib/gares/base.rb', line 55 def lat warn "[DEPRECATION] favor the 'latitude' method instead of 'lat'." latitude end |
#long ⇒ Object
Deprecated.
61 62 63 64 |
# File 'lib/gares/base.rb', line 61 def long warn "[DEPRECATION] favor the 'longitude' method instead of 'long'." longitude end |
#slug ⇒ Object
Deprecated.
49 50 51 52 |
# File 'lib/gares/base.rb', line 49 def slug warn "[DEPRECATION] favor the 'sncf_id' method instead of 'slug'." sncf_id.downcase end |