Permalink
Browse files

Enhancing readability of options for delegate method

  • Loading branch information...
1 parent 69e7e6b commit 786291ded3f7b910094137026377a10cdda52008 @thejamespinto thejamespinto committed Jul 17, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 activesupport/lib/active_support/core_ext/module/delegation.rb
View
5 activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -6,6 +6,11 @@ class DelegationError < NoMethodError; end
# 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).

0 comments on commit 786291d

Please sign in to comment.