Class: String

Inherits:
Object show all
Defined in:
lib/ib/extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_boolObject



29
30
31
32
33
34
35
36
37
38
# 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