mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
17 lines
315 B
Ruby
17 lines
315 B
Ruby
class Method
|
|
def to_proc
|
|
m = self
|
|
lambda { |*args, **opts, &b|
|
|
m.call(*args, **opts, &b)
|
|
}
|
|
end
|
|
|
|
def <<(other)
|
|
->(*args, **opts, &block) { call(other.call(*args, **opts, &block)) }
|
|
end
|
|
|
|
def >>(other)
|
|
->(*args, **opts, &block) { other.call(call(*args, **opts, &block)) }
|
|
end
|
|
end
|