Class/Module Index [+]

Quicksearch

RGen::Util::NameHelper

Public Instance Methods

camelize(str) click to toggle source
# File lib/rgen/util/name_helper.rb, line 34
def camelize(str)
  str.split(/[\W_]/).collect{|s| firstToUpper(s.downcase)}.join
end
className(object) click to toggle source
# File lib/rgen/util/name_helper.rb, line 14
def className(object)
        object.class.name =~ /::(\w+)$/; $1
end
firstToLower(str) click to toggle source
# File lib/rgen/util/name_helper.rb, line 22
def firstToLower(str)
        str[0..0].downcase + ( str[1..-1] || "" )
end
firstToUpper(str) click to toggle source
# File lib/rgen/util/name_helper.rb, line 18
def firstToUpper(str)
        str[0..0].upcase + ( str[1..-1] || "" )
end
normalize(name) click to toggle source
# File lib/rgen/util/name_helper.rb, line 10
def normalize(name)
        name.gsub(/\W/,'_')
end
saneClassName(str) click to toggle source
# File lib/rgen/util/name_helper.rb, line 26
def saneClassName(str)
        firstToUpper(normalize(str)).sub(/^Class$/, 'Clazz')
end
saneMethodName(str) click to toggle source
# File lib/rgen/util/name_helper.rb, line 30
def saneMethodName(str)
        firstToLower(normalize(str)).sub(/^class$/, 'clazz')
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.