private
- def trips_for_stop_code(stop_code:, date_hash:)
+ def trips_for_stop_code(stop_code:, date_hash:, originating_only: false)
stop_ids = @db.query("SELECT stop_id FROM stops WHERE stop_code=?", stop_code).to_a.map do |row|
row.first
end
- trips_for_stop_ids(stop_ids: stop_ids, date_hash: date_hash)
+ trips_for_stop_ids(stop_ids: stop_ids, date_hash: date_hash, originating_only: originating_only)
end
def trips_for_stop_ids(stop_ids:, date_hash:, originating_only: false)
end.to_h
end
- def trips_for_stop_name(stop_name:, date_hash:)
+ def trips_for_stop_name(stop_name:, date_hash:, originating_only: false)
result = {}
base_name = stop_name.upcase
row.first
end
- trips_for_stop_ids(stop_ids: stop_ids, date_hash: date_hash)
+ trips_for_stop_ids(stop_ids: stop_ids, date_hash: date_hash, originating_only: originating_only)
end
def calendar
print "."
$stdout.flush
- route_trips = @gtfs.trips(stop_id: stop_id, date_hash: date_hash).map do |k, v|
+ route_trips = @gtfs.trips(stop_id: stop_id, date_hash: date_hash, originating_only: true).map do |k, v|
[
k.first,
v.map do |x|