10 Things Every Java Programmer Should Know About Ruby
[
P
rev
|
H
o
me
|
N
ext
]
Item #4
Mix it up with Mix-Ins
Although Ruby does not have interfaces, it does have mix-ins defined by modules.
A module…
Is a namespace (like a class)
Can have defined methods (like a class)
Can not be instanciated (unlike a class)
Can be mixed (included) into a class
The module methods become instance methods of the class
O
'
REILLY
®
OSCON 2005
Copyright 2005 by Jim Weirich (All Rights Reserved)