Module: Bort

Defined in:
lib/bort.rb,
lib/bort/route.rb,
lib/bort/station.rb,
lib/bort/realtime.rb,
lib/bort/schedule.rb

Defined Under Namespace

Modules: Realtime, Route, Schedule, Station Classes: InvalidDate, InvalidStation, InvalidTime, Util

Constant Summary collapse

STATIONS =
{
  :"12th" => "12th St. Oakland City Center",
  :"16th" => "16th St. Mission (SF)",
  :"19th" => "19th St. Oakland",
  :"24th" => "24th St. Mission (SF)",
  :ashb   => "Ashby (Berkeley)",
  :balb   => "Balboa Park (SF)",
  :bayf   => "Bay Fair (San Leandro)",
  :cast   => "Castro Valley",
  :civc   => "Civic Center (SF)",
  :cols   => "Coliseum/Oakland Airport",
  :colm   => "Colma",
  :conc   => "Concord",
  :daly   => "Daly City",
  :dbrk   => "Downtown Berkeley",
  :dubl   => "Dublin/Pleasanton",
  :deln   => "El Cerrito del Norte",
  :plza   => "El Cerrito Plaza",
  :embr   => "Embarcadero (SF)",
  :frmt   => "Fremont",
  :ftvl   => "Fruitvale (Oakland)",
  :glen   => "Glen Park (SF)",
  :hayw   => "Hayward",
  :lafy   => "Lafayette",
  :lake   => "Lake Merritt (Oakland)",
  :mcar   => "MacArthur (Oakland)",
  :mlbr   => "Millbrae",
  :mont   => "Montgomery St. (SF)",
  :nbrk   => "North Berkeley",
  :ncon   => "North Concord/Martinez",
  :orin   => "Orinda",
  :pitt   => "Pittsburg/Bay Point",
  :phil   => "Pleasant Hill",
  :powl   => "Powell St. (SF)",
  :rich   => "Richmond",
  :rock   => "Rockridge (Oakland)",
  :sbrn   => "San Bruno",
  :sfia   => "San Francisco Int'l Airport",
  :sanl   => "San Leandro",
  :shay   => "South Hayward",
  :ssan   => "South San Francisco",
  :ucty   => "Union City",
  :wcrk   => "Walnut Creek",
  :woak   => "West Oakland",
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.Bort(key) ⇒ Object



11
12
13
# File 'lib/bort.rb', line 11

def self.Bort(key)
  Util.set_key(key)
end

.fare(orig, dest, options = {}) ⇒ Object



34
35
36
# File 'lib/bort.rb', line 34

def self.fare(orig, dest, options={})
  Schedule::fare(orig, dest, options)
end

.route(route_number, options = {}) ⇒ Object



25
26
27
# File 'lib/bort.rb', line 25

def self.route(route_number, options={})
  Route::Info.new(route_number, options)
end

.routes(options = {}) ⇒ Object



21
22
23
# File 'lib/bort.rb', line 21

def self.routes(options={})
  Route.routes(options)
end

.schedule_at(abbreviation, options = {}) ⇒ Object



42
43
44
# File 'lib/bort.rb', line 42

def self.schedule_at(abbreviation, options={})
  Schedule::StationSchedule.new(abbreviation, options).schedules
end

.schedulesObject



38
39
40
# File 'lib/bort.rb', line 38

def self.schedules
  Schedule.schedules
end

.station_info(abbreviation) ⇒ Object



50
51
52
# File 'lib/bort.rb', line 50

def self.station_info(abbreviation)
  Station.info(abbreviation)
end

.stationsObject



46
47
48
# File 'lib/bort.rb', line 46

def self.stations
  Station.stations
end

.trains_near(orig, filters = {}) ⇒ Object

shortcuts



17
18
19
# File 'lib/bort.rb', line 17

def self.trains_near(orig, filters={})
  Realtime::Estimates.new(orig).select(filters)
end

.trips(orig, dest, options = {}) ⇒ Object



29
30
31
32
# File 'lib/bort.rb', line 29

def self.trips(orig, dest, options={})
  command = options.delete(:by) { 'arrive' }
  Schedule::Trips.new(command, orig, dest, options).trips
end

Instance Method Details

#Bort(key) ⇒ Object



14
# File 'lib/bort.rb', line 14

def Bort(key); Bort::Bort(key); end