Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated the doc for const_regexp [ci skip]

  • Loading branch information...
commit f9086d63cdc21c4098ad3813640f059f0b8265b6 1 parent 3b7192d
@arunagw arunagw authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 activesupport/lib/active_support/inflector/methods.rb
View
4 activesupport/lib/active_support/inflector/methods.rb
@@ -319,7 +319,9 @@ def ordinalize(number)
private
# Mount a regular expression that will match part by part of the constant.
- # For instance, Foo::Bar::Baz will generate Foo(::Bar(::Baz)?)?
+ #
+ # const_regexp("Foo::Bar::Baz") # => /Foo(::Bar(::Baz)?)?/
+ # const_regexp("::") # => /::/
def const_regexp(camel_cased_word) #:nodoc:
parts = camel_cased_word.split("::")
Please sign in to comment.
Something went wrong with that request. Please try again.