Sha256: b6e15b2ca7ae38f4978e22e9503a8e795788c1a189a78893352b8303e8aacfe6
Contents?: true
Size: 549 Bytes
Versions: 10
Compression:
Stored size: 549 Bytes
Contents
module CassandraObject module Types class UTF8StringType def encode(str) # This is technically the most correct, but it is a pain to require utf-8 encoding for all strings. Should revisit. #raise ArgumentError.new("#{self} requires a UTF-8 encoded String") unless str.kind_of?(String) && str.encoding == Encoding::UTF_8 raise ArgumentError.new("#{self} requires a String") unless str.kind_of?(String) str.dup end def decode(str) str.force_encoding('UTF-8') end end end end
Version data entries
10 entries across 10 versions & 1 rubygems