I have written a module similar to the following:
module One
class Two
def self.new(planet)
@world = planet
end
def self.hello
"Hello, #{@world}"
end
end
end
I was going to manipulate the module in the following way:
t = One::Two.new("World")
puts t.hello
Obviously, however, self.hello is not in t‘s scope. I realize that I could do the following:
t = One::Two
t.new("World")
puts t.hello
The previous method doesn’t feel right, so I am looking for an alternative.
1 Answer