Sha256: de58372cb9d17786fa21aa9673277179f294229a87d5c7838cf48f76a6ac948a

Contents?: true

Size: 339 Bytes

Versions: 27

Compression:

Stored size: 339 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.frozen? ? value.dup : value).force_encoding('UTF-8')
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
gotime-cassandra_object-2.7.9 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.7.8 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.7.7 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.7.6 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.7.5 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.7.4 lib/cassandra_object/types/string_type.rb
gotime-cassandra_object-2.7.3 lib/cassandra_object/types/string_type.rb