I came across this in my textbook, but I don't even know what delegation is. I know what inclusion is, but not what delegation is.
In the context of Ruby, compare delegation to module inclusion in terms of the notion of class interfaces.
With module inclusion, methods defined in modules become part of the interface of classes(and all their subclasses). This is not the case with delegations.
Can you explain in layman's terms?
Delegation is, simply put, is when one object uses another object for a method's invocation.
If you have something like this:
An instance of the B class will utilize the A class's
foomethod when itsfoomethod is called. The instance ofBdelegates thefoomethod to theAclass, in other words.