Class: TrueClass
Instance Method Summary collapse
-
#from_user_input(value) ⇒ Object
Either a ‘positive’ string or an actual instance of true.
Instance Method Details
#from_user_input(value) ⇒ Object
Either a ‘positive’ string or an actual instance of true.
35 36 37 38 39 40 41 |
# File 'lib/user_input.rb', line 35 def from_user_input(value) if (value.kind_of?(TrueClass) || /(true|on|y|enabled)/ =~ value.to_s) return true else return nil end end |