Class: StopTime

Inherits:
CUMTD show all
Defined in:
lib/stop_time.rb

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) ⇒ StopTime

Returns a new instance of StopTime.



4
5
6
7
8
9
10
# File 'lib/stop_time.rb', line 4

def initialize(json)
	@arrival_time = DateTime.parse(json["arrival_time"]).to_time
	@departure_time = DateTime.parse(json["departure_time"]).to_time
	@stop_sequence = json["stop_sequence"]
	@stop_point = StopPoint.new(json["stop_point"]) if json["stop_point"]
	@trip = Trip.new(json["trip"]) if json["trip"]
end

Instance Method Details

#arrival_timeObject



12
13
14
# File 'lib/stop_time.rb', line 12

def arrival_time
	@arrival_time
end

#departure_timeObject



16
17
18
# File 'lib/stop_time.rb', line 16

def departure_time
	@departure_time
end

#stop_pointObject



24
25
26
# File 'lib/stop_time.rb', line 24

def stop_point
	@stop_point
end

#stop_sequenceObject



20
21
22
# File 'lib/stop_time.rb', line 20

def stop_sequence
	@stop_sequence
end

#tripObject



28
29
30
# File 'lib/stop_time.rb', line 28

def trip
	@trip
end