Sha256: 5013d16ec991c59f7fa7cbbfb65622b5a4449731460bbb222f6e9fd9152224dd

Contents?: true

Size: 367 Bytes

Versions: 1

Compression:

Stored size: 367 Bytes

Contents

module CassandraObject
  class Types
    module HashType
      def encode(hash)
        raise ArgumentError.new("#{self} requires a Hash") unless hash.kind_of?(Hash)
        ActiveSupport::JSON.encode(hash)
      end
      module_function :encode

      def decode(str)
        ActiveSupport::JSON.decode(str)
      end
      module_function :decode
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gotime-cassandra_object-2.1.0 lib/cassandra_object/types/hash_type.rb