Class: GeojsonModel::Coder

Inherits:
Object
  • Object
show all
Defined in:
lib/geojson_model/coder.rb

Class Method Summary collapse

Class Method Details

.dump(object) ⇒ Object

takes an object and returns the value to be stored in the database



12
13
14
# File 'lib/geojson_model/coder.rb', line 12

def self.dump(object)
  object.to_json
end

.load(value) ⇒ Object

takes the database value and returns an instance of the GeojsonModel class



7
8
9
# File 'lib/geojson_model/coder.rb', line 7

def self.load(value)
  dispatch(JSON.load(value))
end