Module: OCTranspo

Extended by:
ServiceDate
Defined in:
lib/octranspo.rb,
lib/octranspo/stop.rb,
lib/octranspo/route.rb,
lib/octranspo/station.rb,
lib/octranspo/version.rb,
lib/octranspo/headsign.rb,
lib/octranspo/landmarks.rb,
lib/octranspo/service_date.rb,
lib/octranspo/stop_resource.rb,
lib/octranspo/mobile_route_data.rb,
lib/octranspo/mobile_stop_schedule.rb,
lib/octranspo/mobile_route_schedule.rb,
lib/octranspo/mobile_resource_methods.rb,
lib/octranspo/remote_resource_methods.rb

Defined Under Namespace

Modules: Headsign, Landmarks, MobileResourceMethods, MobileRouteData, MobileRouteSchedule, MobileStopSchedule, RemoteResourceMethods, Route, ServiceDate, Station, Stop, StopResource

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Methods included from ServiceDate

service_date, service_date_for

Class Method Details

.stop(options = {}) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/octranspo.rb', line 24

def stop (options={})
  case
  when options[:number]
    OCTranspo::Stop.find_by_number(options[:number])
  when options[:name]
    OCTranspo::Stop.find_by_name(options[:name])
  end
end

.stops(options = {}) ⇒ Object



33
34
35
36
37
38
39
40
# File 'lib/octranspo.rb', line 33

def stops (options={})
  case
  when options[:name].is_a?(Regexp)
    OCTranspo::Stop.find_all_matching(options[:name])
  when options[:name]
    OCTranspo::Stop.find_all_by_name(options[:name])
  end
end