mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-toplevel-ext: implement toplevel public/private/protected
This commit is contained in:
@@ -2,9 +2,22 @@ def self.include(*modules)
|
||||
Object.include(*modules)
|
||||
end
|
||||
|
||||
def self.private(*methods)
|
||||
end
|
||||
def self.protected(*methods)
|
||||
end
|
||||
def self.public(*methods)
|
||||
class <<self
|
||||
private
|
||||
|
||||
def private(*methods)
|
||||
Object.instance_eval do
|
||||
private(*methods)
|
||||
end
|
||||
end
|
||||
def protected(*methods)
|
||||
Object.instance_eval do
|
||||
protected(*methods)
|
||||
end
|
||||
end
|
||||
def public(*methods)
|
||||
Object.instance_eval do
|
||||
public(*methods)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user