Skip to content

Commit

Permalink
[DOC] Refactors documentation for Forwardable
Browse files Browse the repository at this point in the history
[ruby-core:71281] [Misc ruby#11639]

From: Sam Morgan <[email protected]>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Jan 20, 2019
1 parent 46549d6 commit 141ed2f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/forwardable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@
#
# == Another example
#
# We want to rely on what has come before obviously, but with delegation we can
# take just the methods we need and even rename them as appropriate. In many
# cases this is preferable to inheritance, which gives us the entire old
# interface, even if much of it isn't needed.
# You could use Forwardable as an alternative to inheritance, when you don't want
# to inherit all methods from the superclass. For instance, here is how you might
# add a range of +Array+ instance methods to a new class +Queue+:
#
# class Queue
# extend Forwardable
Expand Down

0 comments on commit 141ed2f

Please sign in to comment.