source: EcnlProtoTool/trunk/mruby-2.1.1/mrbgems/mruby-method/mrblib/method.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: 267 bytes
Line 
1class Method
2 def to_proc
3 m = self
4 lambda { |*args, &b|
5 m.call(*args, &b)
6 }
7 end
8
9 def <<(other)
10 ->(*args, &block) { call(other.call(*args, &block)) }
11 end
12
13 def >>(other)
14 ->(*args, &block) { other.call(call(*args, &block)) }
15 end
16end
Note: See TracBrowser for help on using the repository browser.