An object can encounter multiple methods with the same name because its method-lookup path crosses several classes and modules. It executes only the first matching definition. section 4.2.2
Class method versus mixed-in method
If BankAccount includes InterestBearing and both define calculate_interest, an account object finds BankAccount first and runs that implementation. The class method overrides the mixed-in module method. section 4.2.2
When several modules define the same method:
- Search included modules in reverse inclusion order, so the most recently included module takes precedence. section 4.2.2
- Treat repeated same-named methods cautiously; intentional overriding can be useful, but accidental collisions make code harder to read. section 4.2.2
