From f8ca1c2111f4b0b5a181a58faf226682fee0767a Mon Sep 17 00:00:00 2001 From: Sam Morgan Date: Fri, 30 Oct 2015 14:29:24 +0000 Subject: [PATCH] Refactors documentation for `Forwardable` --- lib/forwardable.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/forwardable.rb b/lib/forwardable.rb index ecc5f03..85583f0 100644 --- a/lib/forwardable.rb +++ b/lib/forwardable.rb @@ -56,10 +56,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 -- 2.3.8 (Apple Git-58)