Method: Needle::Container#use!

Defined in:
lib/needle/container.rb

#use!(opts) ⇒ Object

Specifies a set of default options to use temporarily. The original options are returned. This differs from #use in that it will completely replace the original options, instead of merging the parameters with the originals.



408
409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'lib/needle/container.rb', line 408

def use!( opts )
  original = @defaults
  @defaults = opts

  if block_given?
    begin
      yield self
    ensure
      use! original
    end
  end

  return original
end