class String

Public Instance Methods

to_bool() click to toggle source
# File lib/string_to_boolean.rb, line 4
def to_bool
  true_boolean_strings.include?(self)
end

Private Instance Methods

true_boolean_strings() click to toggle source
# File lib/string_to_boolean.rb, line 10
def true_boolean_strings
  ['true', 'True', 't', 'T', 'yes', 'Yes', 'y', 'Y', '1']
end