M
Martin DeMello
module Foo
def display
puts self.class::A
end
end
class Bar
A = 5
include Foo
end
class Baz
A = 6
include Foo
end
Bar.new.display
Baz.new.display
Anything cleaner-looking than self.class::Constant to access the
constant from a method defined in the module?
martin
def display
puts self.class::A
end
end
class Bar
A = 5
include Foo
end
class Baz
A = 6
include Foo
end
Bar.new.display
Baz.new.display
Anything cleaner-looking than self.class::Constant to access the
constant from a method defined in the module?
martin