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



38
39
40
# File 'lib/db/mariadb/native/types.rb', line 38

def name
  "BOOLEAN"
end

#parse(string) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/db/mariadb/native/types.rb', line 42

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