Class: XapianDb::TypeCodec::BooleanCodec
- Inherits:
-
Object
- Object
- XapianDb::TypeCodec::BooleanCodec
- Defined in:
- lib/type_codec.rb
Class Method Summary collapse
-
.decode(string) ⇒ Boolean
Decode a string representing a boolean.
-
.encode(value) ⇒ String
Encode a boolean value to a string.
Class Method Details
.decode(string) ⇒ Boolean
Decode a string representing a boolean
83 84 85 |
# File 'lib/type_codec.rb', line 83 def self.decode(string) string == "true" end |
.encode(value) ⇒ String
Encode a boolean value to a string
76 77 78 |
# File 'lib/type_codec.rb', line 76 def self.encode(value) value.to_s end |