Class: TrueClass

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

Instance Method Summary collapse

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