Method: Binding#with

Defined in:
lib/core/facets/binding/with.rb

#with(_local_variables, &_yields) ⇒ Object

Returns a new binding with local varaibles set.

CREDIT: Trans



7
8
9
# File 'lib/core/facets/binding/with.rb', line 7

def with(_local_variables, &_yields)
  eval("lambda{ |#{_local_variables.keys.join(',')},&yields| binding }").call(*_local_variables.values, &_yields)
end