Class: GoogleMapsPlatform::LocationType1
- Inherits:
-
Object
- Object
- GoogleMapsPlatform::LocationType1
- Defined in:
- lib/google_maps_platform/models/location_type1.rb
Overview
location_type1.
Constant Summary collapse
- LOCATION_TYPE1 =
[ # TODO: Write general description for APPROXIMATE APPROXIMATE = 'APPROXIMATE'.freeze, # TODO: Write general description for GEOMETRIC_CENTER GEOMETRIC_CENTER = 'GEOMETRIC_CENTER'.freeze, # TODO: Write general description for RANGE_INTERPOLATED RANGE_INTERPOLATED = 'RANGE_INTERPOLATED'.freeze, # TODO: Write general description for ROOFTOP ROOFTOP = 'ROOFTOP'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = APPROXIMATE) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/google_maps_platform/models/location_type1.rb', line 29 def self.from_value(value, default_value = APPROXIMATE) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'approximate' then APPROXIMATE when 'geometric_center' then GEOMETRIC_CENTER when 'range_interpolated' then RANGE_INTERPOLATED when 'rooftop' then ROOFTOP else default_value end end |
.validate(value) ⇒ Object
23 24 25 26 27 |
# File 'lib/google_maps_platform/models/location_type1.rb', line 23 def self.validate(value) return false if value.nil? LOCATION_TYPE1.include?(value) end |