class String
Public Instance Methods
camelize(first_letter_in_uppercase = true)
click to toggle source
# File lib/ext/string.rb, line 77 def camelize(first_letter_in_uppercase = true) Inflector.camelize(self, first_letter_in_uppercase) end
constantize()
click to toggle source
# File lib/ext/string.rb, line 73 def constantize Inflector.constantize(self) end
dasherize()
click to toggle source
# File lib/ext/string.rb, line 85 def dasherize Inflector.dasherize(self) end
demodulize()
click to toggle source
# File lib/ext/string.rb, line 89 def demodulize Inflector.demodulize(self) end
foreign_key(separate_class_name_and_id_with_underscore = true)
click to toggle source
# File lib/ext/string.rb, line 93 def foreign_key(separate_class_name_and_id_with_underscore = true) Inflector.foreign_key(self, separate_class_name_and_id_with_underscore) end
ordinalize()
click to toggle source
# File lib/ext/string.rb, line 97 def ordinalize Inflector.ordinalize(self) end
underscore()
click to toggle source
# File lib/ext/string.rb, line 81 def underscore Inflector.underscore(self) end
wrap(col=80)
click to toggle source
# File lib/ext/string.rb, line 101 def wrap(col=80) # http://blog.macromates.com/2006/wrapping-text-with-regular-expressions/ gsub(/(.{1,#{col}})( +|$\n?)|(.{1,#{col}})/, "\\1\\3\n") end