Class: NilClass

Inherits:
Object
  • Object
show all
Defined in:
lib/lab42/stream/proc.rb

Instance Method Summary collapse

Instance Method Details

#make_behavior(*args) ⇒ Object

TODO: Use this from core/fn as soon as available



30
31
32
33
34
35
36
37
38
# File 'lib/lab42/stream/proc.rb', line 30

def make_behavior *args
  return args.first if args.size == 1 && args.first.respond_to?( :call )

  return ->(*a){
    args.first(*(args.drop(1)+a))
  } if args.first.respond_to?( :call )

  sendmsg( *args )
end