mirror of https://github.com/rails/rails
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:
parent
ca9851ae18
commit
f4c8ce9dc8
|
@ -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("::")
|
||||
|
||||
|
|
Loading…
Reference in New Issue