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.
This commit is contained in:
Robin Dupret 2014-08-08 16:10:06 +02:00
parent ca9851ae18
commit f4c8ce9dc8
1 changed files with 4 additions and 3 deletions

View File

@ -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("::")