Sha256: 93a8a181f4ccd6d6642d423a3e37adb8215005533c449380ae2261eb0b85a0e5

Contents?: true

Size: 366 Bytes

Versions: 13

Compression:

Stored size: 366 Bytes

Contents

module CassandraObject
  module Types
    class StringType < BaseType
      def encode(str)
        raise ArgumentError.new("#{self} requires a String") unless str.kind_of?(String)
        str.dup
      end

      def wrap(record, name, value)
        value = value.to_s
        (value.frozen? ? value.dup : value).force_encoding('UTF-8')
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gotime-cassandra_object-2.11.7 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.11.6 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.11.5 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.11.4 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.11.3 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.11.2 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.11.1 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.11.0 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.10.11 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.10.10 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.10.9 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.10.8 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.10.7 lib/cassandra_object/types/string_type.rb