Class: Method

Inherits:
Object show all
Defined in:
mruby/mrbgems/mruby-method/mrblib/method.rb

Instance Method Summary collapse

Instance Method Details

#<<(other) ⇒ Object



9
10
11
# File 'mruby/mrbgems/mruby-method/mrblib/method.rb', line 9

def <<(other)
  ->(*args, **opts, &block) { call(other.call(*args, **opts, &block)) }
end

#>>(other) ⇒ Object



13
14
15
# File 'mruby/mrbgems/mruby-method/mrblib/method.rb', line 13

def >>(other)
  ->(*args, **opts, &block) { other.call(call(*args, **opts, &block)) }
end

#to_procObject



2
3
4
5
6
7
# File 'mruby/mrbgems/mruby-method/mrblib/method.rb', line 2

def to_proc
  m = self
  lambda { |*args, **opts, &b|
    m.call(*args, **opts, &b)
  }
end