aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string/inflections.rb
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2005-10-19 20:20:11 +0000
committerMarcel Molina <marcel@vernix.org>2005-10-19 20:20:11 +0000
commitb23c72fd4220b3d282ec07f63b0571fe5dfc4f0e (patch)
tree7dbe954938956592ae79a164863457601f2cb8cb /activesupport/lib/active_support/core_ext/string/inflections.rb
parent4da2d6c1edee8b31896a206a3ed18e7af605501d (diff)
downloadrails-b23c72fd4220b3d282ec07f63b0571fe5dfc4f0e.tar.gz
rails-b23c72fd4220b3d282ec07f63b0571fe5dfc4f0e.tar.bz2
rails-b23c72fd4220b3d282ec07f63b0571fe5dfc4f0e.zip
Add title case method to String to do, e.g., 'action_web_service'.titlecase # => 'Action Web Service'.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2690 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext/string/inflections.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/string/inflections.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/inflections.rb b/activesupport/lib/active_support/core_ext/string/inflections.rb
index 65107afaf9..9b5e9ddfcd 100644
--- a/activesupport/lib/active_support/core_ext/string/inflections.rb
+++ b/activesupport/lib/active_support/core_ext/string/inflections.rb
@@ -15,6 +15,12 @@ module ActiveSupport #:nodoc:
def camelize
Inflector.camelize(self)
end
+ alias_method :camelcase, :camelize
+
+ def titleize
+ Inflector.titleize(self)
+ end
+ alias_method :titlecase, :titleize
def underscore
Inflector.underscore(self)