Permalink
Browse files

Merge pull request #13092 from laurocaetano/improve_documentation_for…

…_delegate

Improve Module#delegate documentation.
  • Loading branch information...
2 parents 2be3694 + e40ac15 commit c85957ec7c247063cdc2f429c59132935ee64350 @rafaelfranca rafaelfranca committed Nov 29, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -138,6 +138,8 @@ class DelegationError < NoMethodError; end
#
# Foo.new("Bar").name # raises NoMethodError: undefined method `name'
#
+ # The target method must be public, otherwise it will raise +NoMethodError+.
+ #
def delegate(*methods)
options = methods.pop
unless options.is_a?(Hash) && to = options[:to]

0 comments on commit c85957e

Please sign in to comment.