提交 f4c8ce9d 编写于 作者: R Robin Dupret

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.
上级 ca9851ae
......@@ -348,10 +348,11 @@ def ordinalize(number)
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("::")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册