Sha256: 2a675df21de3014eff3542c6f2d47d664470ffd4b7eb34ae41067ecf49773de6
Contents?: true
Size: 430 Bytes
Versions: 10
Compression:
Stored size: 430 Bytes
Contents
module CassandraObject module Types class SetType def encode(set) if set.kind_of?(Set) set.to_json elsif set.kind_of?(Array) set.uniq.to_json else raise ArgumentError.new("#{self} requires an Array or Set") end end def decode(str) return str.to_a if str.kind_of?(Set) ActiveSupport::JSON.decode(str) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems