Class: Route

Inherits:
CUMTD show all
Defined in:
lib/route.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) ⇒ Route

Returns a new instance of Route.



2
3
4
5
6
7
8
# File 'lib/route.rb', line 2

def initialize(json)
  @route_color = json["route_color"]
  @route_id = json["route_id"]
  @route_long_name = json["route_long_name"]
  @route_short_name = json["route_short_name"]
  @route_text_color = json["route_text_color"]
end

Instance Method Details

#route_colorObject



10
11
12
# File 'lib/route.rb', line 10

def route_color
  @route_color
end

#route_idObject



14
15
16
# File 'lib/route.rb', line 14

def route_id
  @route_id
end

#route_long_nameObject



18
19
20
# File 'lib/route.rb', line 18

def route_long_name
  @route_long_name
end

#route_short_nameObject



22
23
24
# File 'lib/route.rb', line 22

def route_short_name
  @route_short_name
end

#route_text_colorObject



26
27
28
# File 'lib/route.rb', line 26

def route_text_color
  @route_text_color
end

#to_json(*a) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/route.rb', line 30

def to_json(*a)
  {
  'route_color' => @route_color,
  'route_id' => @route_id,
  'route_long_name' => @route_long_name,
  'route_short_name' => @route_short_name,
  'route_text_color' => @route_text_color,
  }.to_json(*a)
end