Class: FalseClass

Inherits:
Object show all
Defined in:
lib/user_input.rb

Instance Method Summary collapse

Instance Method Details

#from_user_input(value) ⇒ Object

Either a ‘negative’ string or an actual instance of false.



46
47
48
49
50
51
52
# File 'lib/user_input.rb', line 46

def from_user_input(value)
  if (value.kind_of?(FalseClass) || /(false|off|n|disabled)/ =~ value.to_s)
    return false
  else
    return nil
  end
end