7 ms·
Ok, tell me if I have this correct: module Foo def hello puts "Hello World" end end ...in a different file... foo = Foo.new.msg Q: Wh
by dstorrs 14y ago
Ok, tell me if I have this correct:
module Foo
def hello
puts "Hello World"
end
end
...in a different file...
foo = Foo.new.msg
Q: What does that print?
A: There is no way to tell. It depends on what the 'using' line (not shown) is, and whether anything has refined 'Foo'.
Seems like bad action at a distance, to me. Or am I missing something? The example about the effects of refining 'each' is also pretty disconcerting.