diff options
author | Akshay Vishnoi <akshay.vishnoi@vinsol.com> | 2014-04-11 17:57:16 +0530 |
---|---|---|
committer | Akshay Vishnoi <akshay.vishnoi@vinsol.com> | 2014-04-11 17:57:16 +0530 |
commit | 075a1e21fa59433976dd6860b775a280db10f606 (patch) | |
tree | 4d1ebc5ca7fcbe1187002d0f01be1d151a13bc66 /activesupport/lib/active_support | |
parent | 8c1406cf256c0140748c98cd3c533afc504e0007 (diff) | |
download | rails-075a1e21fa59433976dd6860b775a280db10f606.tar.gz rails-075a1e21fa59433976dd6860b775a280db10f606.tar.bz2 rails-075a1e21fa59433976dd6860b775a280db10f606.zip |
Add more test case for #demodulize, Improve documentation
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/inflections.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/inflector/methods.rb | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/inflections.rb b/activesupport/lib/active_support/core_ext/string/inflections.rb index cf9b1a4ec0..18273573e0 100644 --- a/activesupport/lib/active_support/core_ext/string/inflections.rb +++ b/activesupport/lib/active_support/core_ext/string/inflections.rb @@ -130,6 +130,8 @@ class String # # 'ActiveRecord::CoreExtensions::String::Inflections'.demodulize # => "Inflections" # 'Inflections'.demodulize # => "Inflections" + # '::Inflections'.demodulize # => "Inflections" + # ''.demodulize # => '' # # See also +deconstantize+. def demodulize diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb index a270c4452f..6229d15619 100644 --- a/activesupport/lib/active_support/inflector/methods.rb +++ b/activesupport/lib/active_support/inflector/methods.rb @@ -172,6 +172,8 @@ module ActiveSupport # # 'ActiveRecord::CoreExtensions::String::Inflections'.demodulize # => "Inflections" # 'Inflections'.demodulize # => "Inflections" + # '::Inflections'.demodulize # => "Inflections" + # ''.demodulize # => '' # # See also +deconstantize+. def demodulize(path) |