From f4c8ce9dc816cafa06fc79714623d80bc46a66e5 Mon Sep 17 00:00:00 2001 From: Robin Dupret Date: Fri, 8 Aug 2014 16:10:06 +0200 Subject: 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. --- activesupport/lib/active_support/inflector/methods.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'activesupport/lib/active_support/inflector/methods.rb') 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("::") -- cgit v1.2.3