class Boolean
A boolean type converter.
Definitions
def name
Get the SQL type name for boolean.
Signature
-
returns
String The type name.
Implementation
def name
"BOOLEAN"
end
def parse(string)
Parse a boolean value from the database.
Signature
-
parameter
stringString | Nil The raw string value.
-
returns
Boolean | Integer | Nil The parsed boolean value.
Implementation
def parse(string)
case string
when "0"
false
when "1"
true
when nil
nil
else
Integer(string)
end
end