Class: DB::MariaDB::Native::Types::Boolean

Inherits:
Object
  • Object
show all
Defined in:
lib/db/mariadb/native/types.rb

Instance Method Summary collapse

Instance Method Details

#nameObject



53
54
55
# File 'lib/db/mariadb/native/types.rb', line 53

def name
  "BOOLEAN"
end

#parse(string) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/db/mariadb/native/types.rb', line 57

def parse(string)
  case string
  when '0'
    false
  when '1'
    true
  when nil
    nil
  else
    Integer(string)
  end
end