Method: Cequel::Type::String#cast

Defined in:
lib/cequel/type.rb

#cast(value) ⇒ Object

Since:

  • 1.0.0



182
183
184
185
# File 'lib/cequel/type.rb', line 182

def cast(value)
  str = String(value)
  str.encoding.name == encoding ? str : str.dup.force_encoding(encoding)
end