diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-15 03:42:54 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-15 03:42:54 +0000 |
commit | 643571ca25bc2fcc701e6def0975f56fe10a732f (patch) | |
tree | a6e5aa35aa9e86c349e6620146d0b3d4470373e7 /activesupport/lib/active_support/core_ext/module | |
parent | 3d3ba58dbb2cfd4bbb0c1c868d754134a6f9ea3c (diff) | |
download | rails-643571ca25bc2fcc701e6def0975f56fe10a732f.tar.gz rails-643571ca25bc2fcc701e6def0975f56fe10a732f.tar.bz2 rails-643571ca25bc2fcc701e6def0975f56fe10a732f.zip |
alias_method_chain yields method target and punctuation to simplify wrapper method definition. Used by the deprecate module method.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5113 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/aliasing.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/aliasing.rb b/activesupport/lib/active_support/core_ext/module/aliasing.rb index 19a9297aa4..81e81696d8 100644 --- a/activesupport/lib/active_support/core_ext/module/aliasing.rb +++ b/activesupport/lib/active_support/core_ext/module/aliasing.rb @@ -24,6 +24,7 @@ class Module # Strip out punctuation on predicates or bang methods since # e.g. target?_without_feature is not a valid method name. aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1 + yield(aliased_target, punctuation) if block_given? alias_method "#{aliased_target}_without_#{feature}#{punctuation}", target alias_method target, "#{aliased_target}_with_#{feature}#{punctuation}" end |