diff options
author | Thiago Pinto <tapgyn@gmail.com> | 2013-07-16 22:58:20 -0400 |
---|---|---|
committer | Thiago Pinto <tapgyn@gmail.com> | 2013-07-16 22:58:20 -0400 |
commit | 786291ded3f7b910094137026377a10cdda52008 (patch) | |
tree | 9ddf29d10e518f47b4da380f5a873e06c302172b /activesupport/lib | |
parent | 69e7e6ba89cb1f6aef60d5a446a68785a867c9dd (diff) | |
download | rails-786291ded3f7b910094137026377a10cdda52008.tar.gz rails-786291ded3f7b910094137026377a10cdda52008.tar.bz2 rails-786291ded3f7b910094137026377a10cdda52008.zip |
Enhancing readability of options for delegate method
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/delegation.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb index 1aa72da743..556b1b78f2 100644 --- a/activesupport/lib/active_support/core_ext/module/delegation.rb +++ b/activesupport/lib/active_support/core_ext/module/delegation.rb @@ -6,6 +6,11 @@ class Module # Provides a +delegate+ class method to easily expose contained objects' # public methods as your own. # + # ==== Options + # * <tt>:to</tt> - Specifies the target object + # * <tt>:prefix</tt> - Prefixes the new method with the target name or a custom prefix + # * <tt>:allow_nil</tt> - if set to true, prevents a +NoMethodError+ to be raised + # # The macro receives one or more method names (specified as symbols or # strings) and the name of the target object via the <tt>:to</tt> option # (also a symbol or string). |