aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module/delegation.rb
diff options
context:
space:
mode:
authorThiago Pinto <tapgyn@gmail.com>2013-07-16 22:58:20 -0400
committerThiago Pinto <tapgyn@gmail.com>2013-07-16 22:58:20 -0400
commit786291ded3f7b910094137026377a10cdda52008 (patch)
tree9ddf29d10e518f47b4da380f5a873e06c302172b /activesupport/lib/active_support/core_ext/module/delegation.rb
parent69e7e6ba89cb1f6aef60d5a446a68785a867c9dd (diff)
downloadrails-786291ded3f7b910094137026377a10cdda52008.tar.gz
rails-786291ded3f7b910094137026377a10cdda52008.tar.bz2
rails-786291ded3f7b910094137026377a10cdda52008.zip
Enhancing readability of options for delegate method
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module/delegation.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/module/delegation.rb5
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).