class Scorpion::Nest

A scorpion factory

Attributes

mother[R]

@!attribute @return [Scorpion] the mother scorpion that that will {#conceive} new

scorpions for each request.

Public Class Methods

new( mother = nil ) click to toggle source

@!endgroup Associations

# File lib/scorpion/nest.rb, line 17
def initialize( mother = nil )
  @mother = mother || Scorpion::Hunter.new
end

Public Instance Methods

conceive() click to toggle source

@return [Scorpion] a new scorpion used to hunt for dependencies.

# File lib/scorpion/nest.rb, line 26
def conceive
  mother.replicate
end
destroy() click to toggle source

Free up any persistent resources

# File lib/scorpion/nest.rb, line 31
def destroy
  mother.destroy
  @mother = nil
end
prepare( &block ) click to toggle source
# File lib/scorpion/nest.rb, line 21
def prepare( &block )
  mother.prepare &block
end
reset() click to toggle source

Reset the hunting map and clear all dependencies.

# File lib/scorpion/nest.rb, line 37
def reset
  mother.reset
end