- What do you know about modules already? If little, what would you guess modules are all about?
- Golf and basketball both use a ball. But if you're on a basketball court and ask for "the ball," no one is going to throw you a golf ball. Why? If you were as dumb as a computer, why would a golfd ball be an acceptable response?
- You've learned about the object model and method lookups. What would the imapct be of injecting an additional ancestor into a class' lookup chain?
-
-
Save kjs222/2f078eaa9d93dfd1aff6f460cc00944b to your computer and use it in GitHub Desktop.
Author
kjs222
commented
Apr 13, 2016
- I know little about modules. I think they are like classes, but only have methods, not state? Maybe a series of behavior that is likely to be needed for a given situation that you can access.
- No one throws the golf ball because they take in the context - i.e. that you are standing on a basketball court. The computer doesn't know your context unless you tell it. So it has no basis on which to decide what type of ball to send of all the types of ball it knows about.
- It would give that class access to the methods in the module. The module methods would be superceded by the methods in the class it self.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment