Sha256: 55d8d8aa97a48463977a63ad3f1fb13cb8e49f88ed003d69d33880752dc12a09

Contents?: true

Size: 352 Bytes

Versions: 21

Compression:

Stored size: 352 Bytes

Contents

module CassandraObject
  module Types
    class ArrayType < BaseType
      def encode(array)
        raise ArgumentError.new("#{array.inspect} is not an Array") unless array.kind_of?(Array)
        array.to_a.to_json
      end

      def decode(str)
        return nil if str.blank?

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

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
extendi-cassandra_object-1.0.0 lib/cassandra_object/types/array_type.rb