Modules vs. Classes in Ruby
From David Black’s excellent Ruby for Rails tome:
Entities or things are best modeled in classes, and characteristics or properties of entities or things are best encapsulated in modules. Class names tend to be nouns while module names are often adjectives.
A class can only have one superclass, but it can mix in as many modules as it wants. Don’t use up a class’s one and only superclass relationship to endow the class with what might turn out to be just one of several sets of characteristics.He then gives an example summing up those considerations:
module SelfPropelling
end
class Vehicle
include SelfPropelling
end
class Truck < Vehicle
end