Class: DragonsDream::RailwayInfo
- Inherits:
-
Object
- Object
- DragonsDream::RailwayInfo
- Defined in:
- lib/dragons_dream/railwayinfo.rb
Instance Method Summary collapse
-
#initialize ⇒ RailwayInfo
constructor
A new instance of RailwayInfo.
-
#stations_list(line) ⇒ Array
The list of stations information with given line.
Constructor Details
#initialize ⇒ RailwayInfo
Returns a new instance of RailwayInfo.
4 5 6 |
# File 'lib/dragons_dream/railwayinfo.rb', line 4 def initialize @baseUrl = "http://express.heartrails.com/api/json" end |
Instance Method Details
#stations_list(line) ⇒ Array
Returns the list of stations information with given line.
10 11 12 13 14 15 |
# File 'lib/dragons_dream/railwayinfo.rb', line 10 def stations_list(line) get_line(line)["station"] rescue raise ArgumentError, "line must not be nil" if line.nil? raise end |