Module: EacRubyBase0::Runner::Contexts

Defined in:
lib/eac_ruby_base0/runner/contexts.rb

Instance Method Summary collapse

Instance Method Details

#on_context(&block) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/eac_ruby_base0/runner/contexts.rb', line 11

def on_context(&block)
  top_block = block
  available_contexts.each do |context|
    next if context.object.any?

    last_block = top_block
    top_block = ::Proc.new { context.object.on(context.builder.call, &last_block) }
  end
  top_block.call
end