class String

Public Instance Methods

to_bool() click to toggle source
# File lib/ib/extensions.rb, line 29
def to_bool
  case self.chomp.upcase
    when 'TRUE', 'T', '1'
      true
    when 'FALSE', 'F', '0', ''
      false
    else
      error "Unable to convert #{self} to bool"
  end
end