Sha256: 9082b64e9dc34f5af698b0000f13dd8ee8f14f5cf05e66d067ca3c0b7476ad89

Contents?: true

Size: 372 Bytes

Versions: 27

Compression:

Stored size: 372 Bytes

Contents

module CassandraObject
  module Types
    class StringType < BaseType
      def encode(str)
        raise ArgumentError.new("#{str.inspect} is not 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

27 entries across 27 versions & 2 rubygems

Version Path
gotime-cassandra_object-4.12.2 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.12.1 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.12.0 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.11.6 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.11.5 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.11.4 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.11.3 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.11.2 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.11.1 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.11.0 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.10.5 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.10.4 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.10.3 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.10.2 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.10.1 lib/cassandra_object/types/string_type.rb
cassandra_object_rails-0.0.1 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.10.0 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.9.2 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.9.1 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-4.9.0 lib/cassandra_object/types/string_type.rb