Class: Cequel::Type::String Abstract
Overview
This class is abstract.
Subclasses must implement ‘#encoding`, which returns the name of the Ruby encoding corresponding to the character encoding used for values of this type
Abstract superclass for types that represent character data
Instance Method Summary collapse
Methods inherited from Base
#compatible_types, #cql_aliases, #cql_name, #internal_name, #internal_names, #to_s
Instance Method Details
#cast(value) ⇒ Object
154 155 156 157 |
# File 'lib/cequel/type.rb', line 154 def cast(value) str = String(value) str.encoding.name == encoding ? str : str.dup.force_encoding(encoding) end |