Permalink
Browse files

Improve Module#delegate documentation to tell that delegate don't wor…

…k with private or protected methods. [ci skip]
  • Loading branch information...
1 parent 948c0ff commit e40ac155cadac5162a802f3e36a66198f215417d @laurocaetano laurocaetano 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 e40ac15

Please sign in to comment.