Module: Specdown::SandboxFactory

Extended by:
SandboxFactory
Included in:
SandboxFactory
Defined in:
lib/specdown/sandbox_factory.rb

Instance Method Summary collapse

Instance Method Details

#decorate(&block) ⇒ Object



13
14
15
# File 'lib/specdown/sandbox_factory.rb', line 13

def decorate(&block)
  decorators << block
end

#generateObject



5
6
7
8
9
10
11
# File 'lib/specdown/sandbox_factory.rb', line 5

def generate
  Module.new {}.tap do |sandbox|
    decorators.each do |decorator|
      decorator.call sandbox
    end
  end
end