CSC/ECE 517 Fall 2011/ch4 4c ap

From Expertiza_Wiki
Jump to navigation Jump to search

Modules and Mixins

Regular Expressions

Modules and Mixins

Mixins

Comparable

Composing Modules

Simulating Multiple Inheritance

Multiple Inheritance has several disadvantages that can lead to ambiguous code behavior either during compile time or run time. Ruby does not support direct Multiple Inheritance. But, Mutiple Inheritance can be achieved in Ruby through Modules. Modules simulate multiple inheritance in Ruby.

 Example - Taggable string

Advantages of Multiple Inheritance

Disadvantages of Multiple Inheritance

Extending Specific Objects

See Also

References

External Links