Open fny opened 9 years ago
Since you are using module_function
, you are creating both an instance and a module function. See Ruby's docs:
Creates module functions for the named methods. These functions may be called with the module as a receiver, and also become available as instance methods to classes that mix in the module. Module functions are copies of the original, and so may be changed independently.
So I am afraid I cannot do anything about this behaviour ...
This I know, but you could be clever about it:
module Hello
module_function
def hello
end
end
hello1 = Hello.method(:hello)
hello2 = Hello.instance_method(:hello)
hello1.source_location # => [ '/somewhere/hello.rb', 3 ]
hello2.source_location # => [ '/somewhere/hello.rb', 3 ]
Mmmh, good point :wink:
The module method
Interrobang.bangify_method
was improperly detected as both a module and instance method.Re: [B] Interrobang#bangify_method in fny/interrobang