Class: XapianDb::TypeCodec::StringCodec

Inherits:
Object
  • Object
show all
Defined in:
lib/type_codec.rb

Class Method Summary collapse

Class Method Details

.decode(string) ⇒ String

Decode a string

Parameters:

  • string (String)

    a string

Returns:

  • (String)

    the string



66
67
68
# File 'lib/type_codec.rb', line 66

def self.decode(string)
  string.force_encoding("UTF-8")
end

.encode(object) ⇒ String

Encode an object to a string

Parameters:

  • object (Object)

    an object to encode

Returns:

  • (String)

    the string



59
60
61
# File 'lib/type_codec.rb', line 59

def self.encode(object)
  object.to_s
end