Class: Clomp::Executor

Inherits:
Object
  • Object
show all
Defined in:
lib/clomp/executor.rb

Class Method Summary collapse

Class Method Details

.[](result = {}, options, _self:) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/clomp/executor.rb', line 6

def [](result = {}, options, _self: )
  result['tracks'].each do |track|
    next unless track.track?
    
    _callable_object = Callable[track, options, _self]

    raise Errors::TrackNotDefined, "Please define the track in your operation/service: #{track.name} in #{_callable_object.class}" unless _callable_object.respond_to?(track.name)

    _track = track.exec!(_callable_object, options)
    
    break if _track.failure?
  end
  
  _self
end