diff options
author | Robin Dupret <robin.dupret@gmail.com> | 2014-08-08 16:10:06 +0200 |
---|---|---|
committer | Robin Dupret <robin.dupret@gmail.com> | 2014-08-08 16:13:38 +0200 |
commit | f4c8ce9dc816cafa06fc79714623d80bc46a66e5 (patch) | |
tree | 2086ce51dd8e9da934ca939d98f6d78e4930ccfc | |
parent | ca9851ae189f68d6c10759df34e487b3e4bc7056 (diff) | |
download | rails-f4c8ce9dc816cafa06fc79714623d80bc46a66e5.tar.gz rails-f4c8ce9dc816cafa06fc79714623d80bc46a66e5.tar.bz2 rails-f4c8ce9dc816cafa06fc79714623d80bc46a66e5.zip |
Fix the #const_regexp's documentation [ci skip]
Originally introduced in f9086d63, the documentation of this method is
wrong as #const_regexp returns a string to easy the interpolation inside
regular expressions.
-rw-r--r-- | activesupport/lib/active_support/inflector/methods.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb index 51720d0192..18ba79a8f9 100644 --- a/activesupport/lib/active_support/inflector/methods.rb +++ b/activesupport/lib/active_support/inflector/methods.rb @@ -348,10 +348,11 @@ module ActiveSupport private - # Mount a regular expression that will match part by part of the constant. + # Mounts a regular expression, returned as a string to ease interpolation, + # that will match part by part the given constant. # - # const_regexp("Foo::Bar::Baz") # => /Foo(::Bar(::Baz)?)?/ - # const_regexp("::") # => /::/ + # const_regexp("Foo::Bar::Baz") # => "Foo(::Bar(::Baz)?)?" + # const_regexp("::") # => "::" def const_regexp(camel_cased_word) #:nodoc: parts = camel_cased_word.split("::") |