class String

Public Instance Methods

constantize() click to toggle source
# File lib/rrrmatey/type_coercion.rb, line 23
def constantize
    Module.const_get(self)
end
pluralize() click to toggle source
# File lib/rrrmatey/type_coercion.rb, line 17
def pluralize
    self + "s"
end
to_fixnum_to_date() click to toggle source
# File lib/rrrmatey/type_coercion.rb, line 2
def to_fixnum_to_date
    to_i.to_date
end
underscore() click to toggle source
# File lib/rrrmatey/type_coercion.rb, line 7
def underscore
    self.gsub(/::/, '/').
        gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
        gsub(/([a-z\d])([A-Z])/,'\1_\2').
        tr("- ", "_").
        downcase
end