Sha256: 52ebafac020caadd575df0fd9d1bc117324b5802a7d574754569f4b091e87b61

Contents?: true

Size: 368 Bytes

Versions: 117

Compression:

Stored size: 368 Bytes

Contents

module CassandraObject
  module 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

117 entries across 117 versions & 2 rubygems

Version Path
sessionm-cassandra_object-2.2.23 lib/cassandra_object/types/hash_type.rb
sessionm-cassandra_object-2.2.22 lib/cassandra_object/types/hash_type.rb
sessionm-cassandra_object-2.2.20 lib/cassandra_object/types/hash_type.rb
sessionm-cassandra_object-2.2.18 lib/cassandra_object/types/hash_type.rb
sessionm-cassandra_object-2.2.16 lib/cassandra_object/types/hash_type.rb
sessionm-cassandra_object-2.2.14 lib/cassandra_object/types/hash_type.rb
sessionm-cassandra_object-2.2.12 lib/cassandra_object/types/hash_type.rb
sessionm-cassandra_object-2.2.10 lib/cassandra_object/types/hash_type.rb
sessionm-cassandra_object-2.2.8 lib/cassandra_object/types/hash_type.rb
sessionm-cassandra_object-2.2.6 lib/cassandra_object/types/hash_type.rb
gotime-cassandra_object-2.2.4 lib/cassandra_object/types/hash_type.rb
gotime-cassandra_object-2.2.3 lib/cassandra_object/types/hash_type.rb
gotime-cassandra_object-2.2.2 lib/cassandra_object/types/hash_type.rb
gotime-cassandra_object-2.2.1 lib/cassandra_object/types/hash_type.rb
gotime-cassandra_object-2.2.0 lib/cassandra_object/types/hash_type.rb
gotime-cassandra_object-2.1.2 lib/cassandra_object/types/hash_type.rb
gotime-cassandra_object-2.1.1 lib/cassandra_object/types/hash_type.rb