module QuickShoulda::StringHelpers

Public Instance Methods

camelize(str) click to toggle source
# File lib/quick_shoulda/helpers/string_helpers.rb, line 3
def camelize(str)
  return str if str !~ /_/ && str =~ /[A-Z]+.*/
  str.split("_").map{|e| e.capitalize}.join
end
value_transform(value) click to toggle source
# File lib/quick_shoulda/helpers/string_helpers.rb, line 8
def value_transform(value)
          if value.is_a? String
    "('#{value}')"
  elsif value.is_a? Symbol
    "(:#{value})"
  else
    #fix for 1.8.7
    "(#{value.inspect})"
  end
end