Class: Stop
Instance Method Summary
collapse
Methods inherited from CUMTD
all_routes, all_stops, #api_key, #get_departures_by_stop, #get_reroutes, #get_routes, #get_routes_by_stop, #get_shape_between_stops, #get_shape_by_id, #get_stop_by_id, #get_stop_times_by_stop, #get_stop_times_by_trip, #get_stops, #get_stops_by_lat_lon, #get_stops_by_search, #get_trip_by_id, #get_trips_by_block, #get_vehicle_by_id, #get_vehicles, #get_vehicles_by_route_id, #nearest_departures, #print_all_departures, reroutes, #serialize_routes, #serialize_stops, #serialize_vehicles
Constructor Details
#initialize(json) ⇒ Stop
Returns a new instance of Stop.
2
3
4
5
6
7
8
9
10
|
# File 'lib/stop.rb', line 2
def initialize(json)
@stop_id = json["stop_id"]
@stop_name = json["stop_name"]
@code = json["code"]
@stop_points = Array.new
json["stop_points"].each do |stop_point|
@stop_points << StopPoint.new(stop_point)
end
end
|
Instance Method Details
#code ⇒ Object
20
21
22
|
# File 'lib/stop.rb', line 20
def code
@code
end
|
#stop_id ⇒ Object
12
13
14
|
# File 'lib/stop.rb', line 12
def stop_id
@stop_id
end
|
#stop_name ⇒ Object
16
17
18
|
# File 'lib/stop.rb', line 16
def stop_name
@stop_name
end
|
#stop_points ⇒ Object
24
25
26
|
# File 'lib/stop.rb', line 24
def stop_points
@stop_points
end
|