Class: Igniter::Contracts::Execution::ExecutionResult

Inherits:
Object
  • Object
show all
Defined in:
lib/igniter/contracts/execution/execution_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state:, outputs:, profile_fingerprint:, compiled_graph:) ⇒ ExecutionResult

Returns a new instance of ExecutionResult.



9
10
11
12
13
14
15
# File 'lib/igniter/contracts/execution/execution_result.rb', line 9

def initialize(state:, outputs:, profile_fingerprint:, compiled_graph:)
  @state = state
  @outputs = outputs
  @profile_fingerprint = profile_fingerprint
  @compiled_graph = compiled_graph
  freeze
end

Instance Attribute Details

#compiled_graphObject (readonly)

Returns the value of attribute compiled_graph.



7
8
9
# File 'lib/igniter/contracts/execution/execution_result.rb', line 7

def compiled_graph
  @compiled_graph
end

#outputsObject (readonly)

Returns the value of attribute outputs.



7
8
9
# File 'lib/igniter/contracts/execution/execution_result.rb', line 7

def outputs
  @outputs
end

#profile_fingerprintObject (readonly)

Returns the value of attribute profile_fingerprint.



7
8
9
# File 'lib/igniter/contracts/execution/execution_result.rb', line 7

def profile_fingerprint
  @profile_fingerprint
end

#stateObject (readonly)

Returns the value of attribute state.



7
8
9
# File 'lib/igniter/contracts/execution/execution_result.rb', line 7

def state
  @state
end

Instance Method Details

#output(name) ⇒ Object



17
18
19
# File 'lib/igniter/contracts/execution/execution_result.rb', line 17

def output(name)
  outputs.fetch(name.to_sym)
end

#to_hObject



21
22
23
24
25
26
27
28
# File 'lib/igniter/contracts/execution/execution_result.rb', line 21

def to_h
  {
    state: state.to_h,
    outputs: outputs.to_h,
    profile_fingerprint: profile_fingerprint,
    compiled_graph: compiled_graph.to_h
  }
end