00class.rb: use #__send__ to skip private check

This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-02-14 09:54:37 +09:00
parent e8574b6298
commit 798fd7dbdf
+9 -4
View File
@@ -9,21 +9,26 @@ class BasicObject
end
class Module
# 15.2.2.4.11
alias attr attr_reader
# 15.2.2.4.27
def include(*args)
args.reverse!
mod = self
args.each do |m|
m.append_features(self)
m.included(self)
m.__send__(:append_features, mod)
m.__send__(:included, mod)
end
self
end
def prepend(*args)
args.reverse!
mod = self
args.each do |m|
m.prepend_features(self)
m.prepended(self)
m.__send__(:prepend_features, mod)
m.__send__(:prepended, mod)
end
self
end