Class: DataMapper::Types::Object

Inherits:
DataMapper::Type show all
Defined in:
lib/dm-core/types/object.rb

Constant Summary

Constants inherited from DataMapper::Type

DataMapper::Type::PROPERTY_OPTIONS

Class Method Summary collapse

Methods inherited from DataMapper::Type

bind, configure, inherited, options, primitive

Class Method Details

.dump(value, property) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

TODO: document



16
17
18
# File 'lib/dm-core/types/object.rb', line 16

def self.dump(value, property)
  Base64.encode64(Marshal.dump(value))
end

.load(value, property) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

TODO: document



22
23
24
# File 'lib/dm-core/types/object.rb', line 22

def self.load(value, property)
  value.nil? ? nil : Marshal.load(Base64.decode64(value))
end

.typecast(value, property) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

TODO: document



10
11
12
# File 'lib/dm-core/types/object.rb', line 10

def self.typecast(value, property)
  value
end