Module: Procstar::ArrayCallChain

Defined in:
lib/procstar/array_call_chain.rb

Instance Method Summary collapse

Instance Method Details

#to_procObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/procstar/array_call_chain.rb', line 5

def to_proc
  lambda{ |obj|
    if self.first.is_a? Array
      self.inject(obj){ |result, nested_array|
        nested_array.to_proc.call result
      }
    else
      obj.send(*self)
    end
  }
end