Class: Igniter::Contracts::Environment
- Inherits:
-
Object
- Object
- Igniter::Contracts::Environment
- Defined in:
- lib/igniter/contracts/environment.rb
Instance Attribute Summary collapse
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
Instance Method Summary collapse
- #apply_effect(effect_name, payload:, context: {}) ⇒ Object
- #compilation_report(&block) ⇒ Object
- #compile(&block) ⇒ Object
- #diagnose(result) ⇒ Object
- #execute(compiled_graph, inputs:) ⇒ Object
- #execute_with(executor_name, compiled_graph, inputs:, runtime: Execution::Runtime) ⇒ Object
-
#initialize(profile:) ⇒ Environment
constructor
A new instance of Environment.
- #run(inputs:, &block) ⇒ Object
- #validation_report(&block) ⇒ Object
Constructor Details
#initialize(profile:) ⇒ Environment
Returns a new instance of Environment.
8 9 10 |
# File 'lib/igniter/contracts/environment.rb', line 8 def initialize(profile:) @profile = profile end |
Instance Attribute Details
#profile ⇒ Object (readonly)
Returns the value of attribute profile.
6 7 8 |
# File 'lib/igniter/contracts/environment.rb', line 6 def profile @profile end |
Instance Method Details
#apply_effect(effect_name, payload:, context: {}) ⇒ Object
46 47 48 |
# File 'lib/igniter/contracts/environment.rb', line 46 def apply_effect(effect_name, payload:, context: {}) Contracts.apply_effect(effect_name, payload: payload, context: context, profile: profile) end |
#compilation_report(&block) ⇒ Object
20 21 22 |
# File 'lib/igniter/contracts/environment.rb', line 20 def compilation_report(&block) Contracts.compilation_report(profile: profile, &block) end |
#compile(&block) ⇒ Object
12 13 14 |
# File 'lib/igniter/contracts/environment.rb', line 12 def compile(&block) Contracts.compile(profile: profile, &block) end |
#diagnose(result) ⇒ Object
42 43 44 |
# File 'lib/igniter/contracts/environment.rb', line 42 def diagnose(result) Contracts.diagnose(result, profile: profile) end |
#execute(compiled_graph, inputs:) ⇒ Object
24 25 26 |
# File 'lib/igniter/contracts/environment.rb', line 24 def execute(compiled_graph, inputs:) Contracts.execute(compiled_graph, inputs: inputs, profile: profile) end |
#execute_with(executor_name, compiled_graph, inputs:, runtime: Execution::Runtime) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/igniter/contracts/environment.rb', line 28 def execute_with(executor_name, compiled_graph, inputs:, runtime: Execution::Runtime) Contracts.execute_with( executor_name, compiled_graph, inputs: inputs, profile: profile, runtime: runtime ) end |
#run(inputs:, &block) ⇒ Object
38 39 40 |
# File 'lib/igniter/contracts/environment.rb', line 38 def run(inputs:, &block) execute(compile(&block), inputs: inputs) end |
#validation_report(&block) ⇒ Object
16 17 18 |
# File 'lib/igniter/contracts/environment.rb', line 16 def validation_report(&block) Contracts.validation_report(profile: profile, &block) end |