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 coas-nagasima, 4 years ago

mrubyを2.1.1に更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-ruby;charset=UTF-8
File size: 214 bytes
Line 
1module 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
10end
Note: See TracBrowser for help on using the repository browser.