W
William Webber
Hi all!
I'm trying to understand some code in the stdlib (drb/drb.rb, to be
particular).
Is there any difference between:
module Foo
module_function
def bar()
"baz"
end
end
and
module Foo
def Foo.bar()
"baz"
end
end
?
Am I right in guessing that the former gives both a module and a mixin
function of the same name, whereas the latter gives on a module function?
Or are they in fact identical?
William
I'm trying to understand some code in the stdlib (drb/drb.rb, to be
particular).
Is there any difference between:
module Foo
module_function
def bar()
"baz"
end
end
and
module Foo
def Foo.bar()
"baz"
end
end
?
Am I right in guessing that the former gives both a module and a mixin
function of the same name, whereas the latter gives on a module function?
Or are they in fact identical?
William