Skip to content

Commit

Permalink
Merge pull request #13092 from laurocaetano/improve_documentation_for…
Browse files Browse the repository at this point in the history
…_delegate

Improve Module#delegate documentation.
  • Loading branch information
rafaelfranca committed Nov 29, 2013
2 parents 2be3694 + e40ac15 commit c85957e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Original file line 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' # Foo.new("Bar").name # raises NoMethodError: undefined method `name'
# #
# The target method must be public, otherwise it will raise +NoMethodError+.
#
def delegate(*methods) def delegate(*methods)
options = methods.pop options = methods.pop
unless options.is_a?(Hash) && to = options[:to] unless options.is_a?(Hash) && to = options[:to]
Expand Down

0 comments on commit c85957e

Please sign in to comment.