Slide 67
Slide 67 text
DUAL INTERFACE
Some modules are both a namespace and a mixin
module MoreMath
def self.dist(x1, y1, x2, y2)
Math.sqrt( (x2 - x1) ** 2 +
(y2 - y1) ** 2 )
end
end
module MoreMath
extend Math
def self.dist( x1, y1,
x2, y2 )
sqrt( (x2 - x1) ** 2 +
(y2 - y1) ** 2 )
end
end