aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorArun Agrawal <arunagw@gmail.com>2013-06-15 09:21:12 +0200
committerArun Agrawal <arunagw@gmail.com>2013-06-15 19:14:51 +0200
commitf9086d63cdc21c4098ad3813640f059f0b8265b6 (patch)
tree92d6f911338d535b3a5c5d4d0dff8ba469914645 /activesupport
parent3b7192d21e673002070c852453b3cc32622a7591 (diff)
downloadrails-f9086d63cdc21c4098ad3813640f059f0b8265b6.tar.gz
rails-f9086d63cdc21c4098ad3813640f059f0b8265b6.tar.bz2
rails-f9086d63cdc21c4098ad3813640f059f0b8265b6.zip
Updated the doc for const_regexp [ci skip]
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/inflector/methods.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb
index 9f417af826..a2263fa4d0 100644
--- a/activesupport/lib/active_support/inflector/methods.rb
+++ b/activesupport/lib/active_support/inflector/methods.rb
@@ -319,7 +319,9 @@ module ActiveSupport
private
# Mount a regular expression that will match part by part of the constant.
- # For instance, Foo::Bar::Baz will generate Foo(::Bar(::Baz)?)?
+ #
+ # const_regexp("Foo::Bar::Baz") # => /Foo(::Bar(::Baz)?)?/
+ # const_regexp("::") # => /::/
def const_regexp(camel_cased_word) #:nodoc:
parts = camel_cased_word.split("::")