Sha256: d8749aaa69d045fe0ff84dd4ad868f8515fd0cff863e459c0dca24e9a2966ac9

Contents?: true

Size: 450 Bytes

Versions: 22

Compression:

Stored size: 450 Bytes

Contents

require "base64"

module DataMapper
  module Types
    class Object < DataMapper::Type
      primitive String
      size 65535
      lazy true
      track :hash

      def self.typecast(value, property)
        value
      end

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

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

Version data entries

22 entries across 22 versions & 6 rubygems

Version Path
datamapper-dm-core-0.9.11 lib/dm-core/types/object.rb
joevandyk-dm-core-0.9.6 lib/dm-core/types/object.rb
rpbertp13-dm-core-0.9.11.1 lib/dm-core/types/object.rb
rpbertp13-dm-core-0.9.11.2 lib/dm-core/types/object.rb
sam-dm-core-0.9.10 lib/dm-core/types/object.rb
sam-dm-core-0.9.11 lib/dm-core/types/object.rb
sam-dm-core-0.9.6 lib/dm-core/types/object.rb
sam-dm-core-0.9.7 lib/dm-core/types/object.rb
sam-dm-core-0.9.8 lib/dm-core/types/object.rb
sam-dm-core-0.9.9 lib/dm-core/types/object.rb
dm-core-0.9.11 lib/dm-core/types/object.rb
dm-core-0.9.10 lib/dm-core/types/object.rb
dm-core-0.9.6 lib/dm-core/types/object.rb
dm-core-0.9.5 lib/dm-core/types/object.rb
dm-core-0.9.4 lib/dm-core/types/object.rb
dm-core-0.9.7 lib/dm-core/types/object.rb
dm-core-0.9.3 lib/dm-core/types/object.rb
dm-core-0.9.8 lib/dm-core/types/object.rb
dm-core-0.9.9 lib/dm-core/types/object.rb
mack-data_mapper-0.8.2 lib/gems/dm-core-0.9.7/lib/dm-core/types/object.rb