Class: DataMapper::Types::Object
- Inherits:
-
DataMapper::Type
- Object
- DataMapper::Type
- DataMapper::Types::Object
- Defined in:
- lib/dm-core/types/object.rb
Constant Summary
Constants inherited from DataMapper::Type
DataMapper::Type::PROPERTY_OPTIONS
Class Method Summary collapse
- .dump(value, property) ⇒ Object private
- .load(value, property) ⇒ Object private
- .typecast(value, property) ⇒ Object private
Methods inherited from DataMapper::Type
bind, configure, inherited, nullable, 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.
15 16 17 |
# File 'lib/dm-core/types/object.rb', line 15 def self.dump(value, property) [ Marshal.dump(value) ].pack('m') unless value.nil? 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.
20 21 22 |
# File 'lib/dm-core/types/object.rb', line 20 def self.load(value, property) Marshal.load(value.unpack('m').first) unless value.nil? 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.
10 11 12 |
# File 'lib/dm-core/types/object.rb', line 10 def self.typecast(value, property) value end |