Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/ext/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#to_booleanObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/ext/core_ext.rb', line 2

def to_boolean
  case self
  when 'true'
    true
  when 'false'
    false
  else
    nil
  end
end