Class: DataMapper::Property::ParsePointer

Inherits:
Object
  • Object
show all
Defined in:
lib/property/parse_pointer.rb

Instance Method Summary collapse

Instance Method Details

#dump(value) ⇒ Object



6
7
8
# File 'lib/property/parse_pointer.rb', line 6

def dump(value)
  value && {"__type" => "Pointer", "className" => target_storage_name, "objectId" => value.to_s}
end

#load(value) ⇒ Object



10
11
12
# File 'lib/property/parse_pointer.rb', line 10

def load(value)
  value.is_a?(Hash) ? value["objectId"] : super
end