Module: Yogo::Support::Proc::Partial

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

Instance Method Summary collapse

Instance Method Details

#partial(*args) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/yogo/support/proc/partial.rb', line 7

def partial(*args)
  ::Proc.new do |*spice|
    result = args.collect do |a|
      X == a ? spice.shift : a
    end
    call(*result)
  end
end