Sha256: ee013971bc5ac5cb00886509a513d309dbad2e21777576c329ea5979858cbf69

Contents?: true

Size: 498 Bytes

Versions: 1

Compression:

Stored size: 498 Bytes

Contents

require 'json'

# Non-lazy objects that serialize to/from JSON, for use with couchdb
module DataMapper
  module Types
    class JsonObject < DataMapper::Type
      primitive String
      size 65535

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

      def self.dump(value, property)
        value.nil? ? nil : value
      end

      def self.typecast(value, property)
        value
      end
    end # class JsonObject
  end # module Types
end # module DataMapper

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dm-couchdb-adapter-0.10.2 lib/couchdb_adapter/json_object.rb