class StringHelper

Public Class Methods

constantize(word) click to toggle source
# File lib/string_helper.rb, line 14
def self.constantize(word)
  word.constantize
end
singularize(word) click to toggle source

super simple singularizer

# File lib/string_helper.rb, line 10
def self.singularize(word)
  word.gsub /(.*)s/,'\1'
end
to_class(word) click to toggle source
# File lib/string_helper.rb, line 5
def self.to_class(word)
  singularize(word.to_s).camelize.constantize
end