0
나는 다음과 같은 모듈이있다 :루비 모듈 방식 접근성
module Foo
def f1 x
puts "f1(#{x})"
end
def Foo.f2 x
puts "f2(#{x})"
end
end
그것은 클래스에 포함되는 경우 :
class Bar
include Foo
Foo.f2 "bar" # This works
f1 "bar" # Missing method
def b x
f1 x # This works too
end
end
이유는 두 경우에 다른 F1의 행동?
모듈 메타의 범위는 어떻게 정의됩니까?
f1은 f1 "bar"
처럼 작동 할 수 있습니까? 예를 들어 Rakefile의 task
처럼?