source:
EcnlProtoTool/trunk/mruby-2.1.1/mrbgems/mruby-method/mrblib/kernel.rb@
439
Last change on this file since 439 was 439, checked in by , 4 years ago | |
---|---|
|
|
File size: 214 bytes |
Line | |
---|---|
1 | module Kernel |
2 | def singleton_method(name) |
3 | m = method(name) |
4 | sc = (class <<self; self; end) |
5 | if m.owner != sc |
6 | raise NameError, "undefined method '#{name}' for class '#{sc}'" |
7 | end |
8 | m |
9 | end |
10 | end |
Note:
See TracBrowser
for help on using the repository browser.