Files
mruby-mruby/mrbgems/mruby-method/mrblib/method.rb
T
2019-09-16 10:10:09 +09:00

17 lines
267 B
Ruby

class Method
def to_proc
m = self
lambda { |*args, &b|
m.call(*args, &b)
}
end
def <<(other)
->(*args, &block) { call(other.call(*args, &block)) }
end
def >>(other)
->(*args, &block) { other.call(call(*args, &block)) }
end
end