Project

General

Profile

Actions

Bug #8346

closed

If a module is included, its public instance methods behave like module functions

Added by alexeymuranov (Alexey Muranov) almost 11 years ago. Updated almost 11 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
2.0.0
[ruby-core:54690]

Description

=begin
This behavior is unexpected to me:

module M
def f
1
end
end
include M

M.f # => 1

After including the module (({M})), the method (({f})) becomes an instance method of the module for no apparent reason. I would expect an error (instance method not found).
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0