In accordance with the documentation Class.new
Creates a new anonymous (unnamed) class with the given superclass (or Object, if the parameter is not specified).
Besides,
You can give a class a name by assigning the class object to a constant.
Sheep is a constant, so your code is equivalent:
module Fence
class Sheep
def speak
"Bah."
end
end
end
source
share