Method: Needle::Container#use

Defined in:
lib/needle/container.rb

#use(opts, &block) ⇒ Object

Specifies a set of default options to use temporarily. The options are merged with the current set of defaults for the container. The original options are returned, and may be restored by invoking #use again with the hash that is returned. If a block is given, the registry will be yielded to it and the options automatically restored when the block returns.



400
401
402
# File 'lib/needle/container.rb', line 400

def use( opts, &block ) # :yield: self
  use! @defaults.merge( opts ), &block
end