가 나는 인스턴스 메서드 가능한가 내가 모듈에서이 방법모듈에서 인스턴스 메소드를 덮어 쓸 수 있습니까?
class Foo
class << self
def some_static_method
puts 'some_static_method'
end
end
end
module BAR
class << Foo
def some_static_method
puts 'another_static_method'
end
end
end
class Foo
include BAR
end
Foo.some_static_method # => 'another_static_method'
를 클래스 메소드를 덮어 쓸 수 있습니다, 알아?
[여기] (http://stackoverflow.com/questions/5944278/overriding-method-by-another-defined-in-module) 정보를 찾을 수 있습니다. – maxdec