module Procstar::ArrayCallChain

Public Instance Methods

to_proc() click to toggle source
# 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