Class: Igniter::Contracts::Execution::ExecutionRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(compiled_graph:, inputs:, profile:, runtime:) ⇒ ExecutionRequest

Returns a new instance of ExecutionRequest.



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

def initialize(compiled_graph:, inputs:, profile:, runtime:)
  @compiled_graph = compiled_graph
  @inputs = inputs.is_a?(NamedValues) ? inputs : NamedValues.new(inputs)
  @profile = profile
  @runtime = runtime
  freeze
end

Instance Attribute Details

#compiled_graphObject (readonly)

Returns the value of attribute compiled_graph.



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

def compiled_graph
  @compiled_graph
end

#inputsObject (readonly)

Returns the value of attribute inputs.



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

def inputs
  @inputs
end

#profileObject (readonly)

Returns the value of attribute profile.



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

def profile
  @profile
end

#runtimeObject (readonly)

Returns the value of attribute runtime.



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

def runtime
  @runtime
end

Instance Method Details

#to_hObject



17
18
19
20
21
22
23
24
# File 'lib/igniter/contracts/execution/execution_request.rb', line 17

def to_h
  {
    compiled_graph: StructuredDump.dump(compiled_graph),
    inputs: inputs.to_h,
    profile_fingerprint: profile.fingerprint,
    runtime: runtime.name
  }
end