class String

Public Instance Methods

to_bool() click to toggle source
# File lib/ext/to_bool.rb, line 13
def to_bool
  return true if self == "\x01" || self == "1"
  return false if self == "\x00" || self == "0"

  raise "String '#{self}' can't be converted to Boolean."
end