Module: Yogo::Support::Proc::Compose

Defined in:
lib/yogo/support/proc/compose.rb

Instance Method Summary collapse

Instance Method Details

#*(x) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/yogo/support/proc/compose.rb', line 9

def *(x)
  if Integer===x
    c = []
    x.times{|i| c << call(i)}
    c
  else
    compose(x)
  end
end

#compose(g) ⇒ Object



5
6
7
# File 'lib/yogo/support/proc/compose.rb', line 5

def compose(g)
  lambda{|*args| self[*g[*args]] }
end