mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
00class.rb: use #__send__ to skip private check
This commit is contained in:
+9
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user