summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-method/mrblib/method.rb
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-method/mrblib/method.rb')
-rw-r--r--mrbgems/mruby-method/mrblib/method.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/mrbgems/mruby-method/mrblib/method.rb b/mrbgems/mruby-method/mrblib/method.rb
index 5de0afdf7..f7cefa2e5 100644
--- a/mrbgems/mruby-method/mrblib/method.rb
+++ b/mrbgems/mruby-method/mrblib/method.rb
@@ -17,4 +17,12 @@ class Method
def name
@name
end
+
+ def <<(other)
+ ->(*args, &block) { call(other.call(*args, &block)) }
+ end
+
+ def >>(other)
+ ->(*args, &block) { other.call(call(*args, &block)) }
+ end
end