Class: Dina::GeospatialCaster

Inherits:
Object
  • Object
show all
Defined in:
lib/dina/casters/geospatial_caster.rb

Class Method Summary collapse

Class Method Details

.cast(value, default) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/dina/casters/geospatial_caster.rb', line 5

def self.cast(value, default)
  begin
    Geospatial.new(value).to_hash
  rescue ArgumentError
    { type: "", coordinates: [] }
  end
end