Class: GoogleMapsPlatform::Maneuver
- Inherits:
-
Object
- Object
- GoogleMapsPlatform::Maneuver
- Defined in:
- lib/google_maps_platform/models/maneuver.rb
Overview
Contains the action to take for the current step (turn left, merge, straight, etc.). Values are subject to change, and new values may be introduced without prior notice.
Constant Summary collapse
- MANEUVER =
[ # TODO: Write general description for TURNSLIGHTLEFT TURNSLIGHTLEFT = 'turn-slight-left'.freeze, # TODO: Write general description for TURNSHARPLEFT TURNSHARPLEFT = 'turn-sharp-left'.freeze, # TODO: Write general description for TURNLEFT TURNLEFT = 'turn-left'.freeze, # TODO: Write general description for TURNSLIGHTRIGHT TURNSLIGHTRIGHT = 'turn-slight-right'.freeze, # TODO: Write general description for TURNSHARPRIGHT TURNSHARPRIGHT = 'turn-sharp-right'.freeze, # TODO: Write general description for KEEPRIGHT KEEPRIGHT = 'keep-right'.freeze, # TODO: Write general description for KEEPLEFT KEEPLEFT = 'keep-left'.freeze, # TODO: Write general description for UTURNLEFT UTURNLEFT = 'uturn-left'.freeze, # TODO: Write general description for UTURNRIGHT UTURNRIGHT = 'uturn-right'.freeze, # TODO: Write general description for TURNRIGHT TURNRIGHT = 'turn-right'.freeze, # TODO: Write general description for STRAIGHT STRAIGHT = 'straight'.freeze, # TODO: Write general description for RAMPLEFT RAMPLEFT = 'ramp-left'.freeze, # TODO: Write general description for RAMPRIGHT RAMPRIGHT = 'ramp-right'.freeze, # TODO: Write general description for MERGE MERGE = 'merge'.freeze, # TODO: Write general description for FORKLEFT FORKLEFT = 'fork-left'.freeze, # TODO: Write general description for FORKRIGHT FORKRIGHT = 'fork-right'.freeze, # TODO: Write general description for FERRY FERRY = 'ferry'.freeze, # TODO: Write general description for FERRYTRAIN FERRYTRAIN = 'ferry-train'.freeze, # TODO: Write general description for ROUNDABOUTLEFT ROUNDABOUTLEFT = 'roundabout-left'.freeze, # TODO: Write general description for ROUNDABOUTRIGHT ROUNDABOUTRIGHT = 'roundabout-right'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = TURNSLIGHTLEFT) ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/google_maps_platform/models/maneuver.rb', line 79 def self.from_value(value, default_value = TURNSLIGHTLEFT) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'turnslightleft' then TURNSLIGHTLEFT when 'turnsharpleft' then TURNSHARPLEFT when 'turnleft' then TURNLEFT when 'turnslightright' then TURNSLIGHTRIGHT when 'turnsharpright' then TURNSHARPRIGHT when 'keepright' then KEEPRIGHT when 'keepleft' then KEEPLEFT when 'uturnleft' then UTURNLEFT when 'uturnright' then UTURNRIGHT when 'turnright' then TURNRIGHT when 'straight' then STRAIGHT when 'rampleft' then RAMPLEFT when 'rampright' then RAMPRIGHT when 'merge' then MERGE when 'forkleft' then FORKLEFT when 'forkright' then FORKRIGHT when 'ferry' then FERRY when 'ferrytrain' then FERRYTRAIN when 'roundaboutleft' then ROUNDABOUTLEFT when 'roundaboutright' then ROUNDABOUTRIGHT else default_value end end |
.validate(value) ⇒ Object
73 74 75 76 77 |
# File 'lib/google_maps_platform/models/maneuver.rb', line 73 def self.validate(value) return false if value.nil? MANEUVER.include?(value) end |