Module: DeepCover::Node::Mixin::CheckCompletion

Defined in:
lib/deep_cover/node/mixin/check_completion.rb

Instance Method Summary collapse

Instance Method Details

#check_completion(outer: '(%{node})', inner: '(%{node})') ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/deep_cover/node/mixin/check_completion.rb', line 8

def check_completion(outer: '(%{node})', inner: '(%{node})')
  has_tracker :completion
  include ExecutedAfterChildren
  alias_method :flow_completion_count, :completion_tracker_hits
  pre, post = outer.split('%{node}')
  # The local=local is to avoid Ruby warning about "Possible use of value in void context"
  define_method(:rewrite) { "#{pre}(%{local}=#{inner};%{completion_tracker};%{local}=%{local})#{post}" }
end