class String

Public Instance Methods

parameterize!(underscore = false)
Alias for: permalink!
to_bool() click to toggle source
# File lib/locomotive/common/core_ext/string.rb, line 5
def to_bool
  return true if self == true || self =~ (/(true|t|yes|y|1)$/i)
  return false if self == false || blank? || self =~ (/(false|f|no|n|0)$/i)

  raise ArgumentError, "invalid value for Boolean: \"#{self}\""
end