Skip to content

Commit

Permalink
Improve Module#delegate documentation to tell that delegate don't wor…
Browse files Browse the repository at this point in the history
…k with private or protected methods. [ci skip]
  • Loading branch information
laurocaetano committed Nov 29, 2013
1 parent 948c0ff commit e40ac15
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit e40ac15

Please sign in to comment.