Class: CTA::Trip

Inherits:
Sequel::Model
  • Object
show all
Defined in:
lib/cta_redux/models/trip.rb

Overview

Note:

Current columns: [:route_id, :service_id, :trip_id, :direction_id, :block_id, :shape_id, :direction, :wheelchair_accessible, :schd_trip_id]

A Sequel::Model. This corresponds to trips.txt in the GTFS feed, though the CTA does not fully implement the standard.

Direct Known Subclasses

Bus, Train

Constant Summary collapse

L_ROUTES =
["Brn", "G", "Pink", "P", "Org", "Red", "Blue", "Y"]
BUS_ROUTES =
CTA::Trip.exclude(:route_id => L_ROUTES).select_map(:route_id).uniq

Instance Method Summary collapse

Instance Method Details

#block_idInteger

Returns:

  • (Integer)

67
# File 'lib/cta_redux/models/trip.rb', line 67

alias_method :id, :route_id

#calendarCTA::Calendar

Returns The Calendar entry for this CTA::Trip. Can be used to determine if a given CTA::Trip is valid for a given date/time.

Returns:


31
# File 'lib/cta_redux/models/trip.rb', line 31

many_to_one :calendar, :key => :service_id

#directionString

Returns:

  • (String)

67
# File 'lib/cta_redux/models/trip.rb', line 67

alias_method :id, :route_id

#direction_idInteger

Returns:

  • (Integer)

67
# File 'lib/cta_redux/models/trip.rb', line 67

alias_method :id, :route_id

#routeCTA::Route

Returns The Route associated with this CTA::Trip.

Returns:


39
# File 'lib/cta_redux/models/trip.rb', line 39

many_to_one :route, :key => :route_id

#route_idString Also known as: id

Returns:

  • (String)

67
# File 'lib/cta_redux/models/trip.rb', line 67

alias_method :id, :route_id

#schd_trip_idString Also known as: scheduled_trip_id, run

Returns:

  • (String)

67
# File 'lib/cta_redux/models/trip.rb', line 67

alias_method :id, :route_id

#service_idInteger

Returns:

  • (Integer)

67
# File 'lib/cta_redux/models/trip.rb', line 67

alias_method :id, :route_id

#shape_idInteger

Returns:

  • (Integer)

67
# File 'lib/cta_redux/models/trip.rb', line 67

alias_method :id, :route_id

#shapesArray<CTA::Shape>

Returns All Shapes related to this CTA::Trip.

Returns:


47
# File 'lib/cta_redux/models/trip.rb', line 47

many_to_many :shapes, :left_key => :trip_id, :right_key => :shape_id, :join_table => :trips

#stop_timesArray<CTA::StopTime>

Returns The StopTimes that are serviced on this CTA::Trip.

Returns:


35
# File 'lib/cta_redux/models/trip.rb', line 35

one_to_many :stop_times, :key => :trip_id

#stopsArray<CTA::Stop>

Returns All Stops serviced on this CTA::Trip.

Returns:


43
# File 'lib/cta_redux/models/trip.rb', line 43

many_to_many :stops, :left_key => :trip_id, :right_key => :stop_id, :join_table => :stop_times

#trip_idInteger

Returns:

  • (Integer)

67
# File 'lib/cta_redux/models/trip.rb', line 67

alias_method :id, :route_id

#wheelchair_accessibletrue, false

Returns:

  • (true, false)

67
# File 'lib/cta_redux/models/trip.rb', line 67

alias_method :id, :route_id