Module: Ratis
- Extended by:
- Ratis
- Included in:
- Ratis
- Defined in:
- lib/ratis.rb,
lib/ratis/area.rb,
lib/ratis/stop.rb,
lib/ratis/route.rb,
lib/ratis/config.rb,
lib/ratis/errors.rb,
lib/ratis/routes.rb,
lib/ratis/pattern.rb,
lib/ratis/request.rb,
lib/ratis/version.rb,
lib/ratis/landmark.rb,
lib/ratis/location.rb,
lib/ratis/next_bus.rb,
lib/ratis/plantrip.rb,
lib/ratis/walkstop.rb,
lib/ratis/itinerary.rb,
lib/ratis/next_bus2.rb,
lib/ratis/timetable.rb,
lib/ratis/itin_trace.rb,
lib/ratis/route_stops.rb,
lib/ratis/closest_stop.rb,
lib/ratis/point_2_point.rb,
lib/ratis/route_pattern.rb,
lib/ratis/fleet_location.rb,
lib/ratis/timetable/stop.rb,
lib/ratis/timetable/trip.rb,
lib/ratis/schedule_nearby.rb,
lib/ratis/route_stops/stop.rb,
lib/ratis/landmark_category.rb,
lib/ratis/pattern/routeinfo.rb,
lib/ratis/point_2_point/stop.rb,
lib/ratis/point_2_point/trip.rb,
lib/ratis/route_pattern/stop.rb,
lib/ratis/location_type_ahead.rb,
lib/ratis/point_2_point/group.rb,
lib/ratis/route_pattern/point.rb,
lib/ratis/point_2_point/service.rb,
lib/ratis/location_type_ahead_item.rb,
lib/ratis/point_2_point/standard_response.rb,
lib/ratis/point_2_point/routes_only_response.rb
Defined Under Namespace
Modules: Errors
Classes: Area, ClosestStop, Config, Error, FleetLocation, ItinTrace, Itinerary, Landmark, LandmarkCategory, Location, LocationTypeAhead, LocationTypeAheadItem, NextBus, NextBus2, Pattern, Plantrip, Point2Point, Request, Route, RoutePattern, RouteStops, Routes, ScheduleNearby, Stop, Timetable, Vehicle, Walkstop
Instance Method Summary
collapse
Instance Method Details
#all_conditions_used?(conditions) ⇒ Boolean
65
66
67
|
# File 'lib/ratis.rb', line 65
def all_conditions_used?(conditions)
raise ArgumentError.new("Conditions not used by this class: #{conditions.keys.inspect}") unless conditions.empty?
end
|
#config ⇒ Object
53
54
55
|
# File 'lib/ratis.rb', line 53
def config
@config ||= Config.new
end
|
49
50
51
|
# File 'lib/ratis.rb', line 49
def configure
yield config
end
|
#reset ⇒ Object
null out the config so that it can be rewritten to, then used in new ‘get’ calls
70
71
72
|
# File 'lib/ratis.rb', line 70
def reset
@config = nil
end
|
#valid_latitude?(lat) ⇒ Boolean
57
58
59
|
# File 'lib/ratis.rb', line 57
def valid_latitude?(lat)
-90.0 <= lat.to_f and lat.to_f <= 90.0
end
|
#valid_longitude?(lon) ⇒ Boolean
61
62
63
|
# File 'lib/ratis.rb', line 61
def valid_longitude?(lon)
-180.0 <= lon.to_f and lon.to_f <= 180.0
end
|
#version ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/ratis/version.rb', line 5
def version
@version ||= begin
string = '3.6.2'
def string.parts
split('.').map { |p| p.to_i }
end
def string.major
parts[0]
end
def string.minor
parts[1]
end
def string.build
parts[2]
end
string
end
end
|