servactory 2.10.0 → 2.12.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/servactory/context/callable.rb +0 -2
- data/lib/servactory/context/warehouse/base.rb +25 -0
- data/lib/servactory/context/warehouse/inputs.rb +56 -0
- data/lib/servactory/context/warehouse/internals.rb +10 -0
- data/lib/servactory/context/warehouse/outputs.rb +12 -0
- data/lib/servactory/context/warehouse/setup.rb +73 -0
- data/lib/servactory/context/workspace/inputs.rb +4 -5
- data/lib/servactory/context/workspace/internals.rb +2 -2
- data/lib/servactory/context/workspace/outputs.rb +2 -2
- data/lib/servactory/context/workspace.rb +3 -7
- data/lib/servactory/inputs/tools/unnecessary.rb +4 -3
- data/lib/servactory/inputs/tools/validation.rb +2 -3
- data/lib/servactory/inputs/tools/warehouse.rb +28 -0
- data/lib/servactory/inputs/workspace.rb +5 -3
- data/lib/servactory/maintenance/attributes/option.rb +4 -4
- data/lib/servactory/result.rb +1 -1
- data/lib/servactory/test_kit/result.rb +3 -3
- data/lib/servactory/version.rb +2 -2
- metadata +11 -9
- data/lib/servactory/context/store.rb +0 -58
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42d8f2391ba24198b46219e80408d7bf1d304faca0dfd5a99e89ac841d246fe4
|
4
|
+
data.tar.gz: 93748b84e352a85641a18e2f50f7fbc1668c7d037a613b95f8ed47fe02fce079
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45895d6e4182f0ccdb4fd0c37e030232d809d8fb14d6117f793c5abac5292ceb172d5cd1aeb1fc48cb3cbda70e0ce4ba08a8752744f4776f431136b2c7b1dc8e
|
7
|
+
data.tar.gz: 97e972f65d377eec5eb1224d54c440e7cca90c66a32fd2fd398e87c482f355110fbc39453cfdca799b45e59af259bf5e393c039181e23f59ecb41bbfe5d478aa
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Servactory
|
4
|
+
module Context
|
5
|
+
module Warehouse
|
6
|
+
class Base
|
7
|
+
def initialize(arguments = {})
|
8
|
+
@arguments = arguments
|
9
|
+
end
|
10
|
+
|
11
|
+
# def fetch!(name)
|
12
|
+
# @arguments.fetch(name)
|
13
|
+
# end
|
14
|
+
|
15
|
+
def fetch(name, default_value)
|
16
|
+
@arguments.fetch(name, default_value)
|
17
|
+
end
|
18
|
+
|
19
|
+
def assign(key, value)
|
20
|
+
@arguments[key] = value
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Servactory
|
4
|
+
module Context
|
5
|
+
module Warehouse
|
6
|
+
class Inputs < Base
|
7
|
+
def initialize(context, arguments = {})
|
8
|
+
@context = context
|
9
|
+
|
10
|
+
super(arguments)
|
11
|
+
end
|
12
|
+
|
13
|
+
def names
|
14
|
+
@arguments.keys
|
15
|
+
end
|
16
|
+
|
17
|
+
def merge!(arguments)
|
18
|
+
@arguments.merge!(arguments)
|
19
|
+
end
|
20
|
+
|
21
|
+
##########################################################################
|
22
|
+
|
23
|
+
def method_missing(name, *_args)
|
24
|
+
input_name = @context.class.config.predicate_methods_enabled? ? name.to_s.chomp("?").to_sym : name
|
25
|
+
|
26
|
+
input_value = @arguments.fetch(input_name) { raise_error_for(input_name) }
|
27
|
+
|
28
|
+
if name.to_s.end_with?("?") && @context.class.config.predicate_methods_enabled?
|
29
|
+
Servactory::Utils.query_attribute(input_value)
|
30
|
+
else
|
31
|
+
input_value
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def respond_to_missing?(name, *)
|
36
|
+
@arguments.fetch(name) { raise_error_for(name) }
|
37
|
+
end
|
38
|
+
|
39
|
+
##########################################################################
|
40
|
+
|
41
|
+
def raise_error_for(input_name)
|
42
|
+
message_text = @context.send(:servactory_service_info).translate(
|
43
|
+
"inputs.undefined.for_fetch",
|
44
|
+
input_name:
|
45
|
+
)
|
46
|
+
|
47
|
+
raise @context.class.config.input_exception_class.new(
|
48
|
+
context: @context,
|
49
|
+
message: message_text,
|
50
|
+
input_name:
|
51
|
+
)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Servactory
|
4
|
+
module Context
|
5
|
+
module Warehouse
|
6
|
+
class Setup
|
7
|
+
def initialize(context)
|
8
|
+
@context = context
|
9
|
+
end
|
10
|
+
|
11
|
+
def assign_inputs(arguments)
|
12
|
+
context_data[:inputs].merge!(arguments)
|
13
|
+
end
|
14
|
+
|
15
|
+
def fetch_input(name)
|
16
|
+
inputs.fetch(name, nil)
|
17
|
+
end
|
18
|
+
|
19
|
+
def assign_internal(name, value)
|
20
|
+
assign_attribute(:internals, name, value)
|
21
|
+
end
|
22
|
+
|
23
|
+
def fetch_internal(name)
|
24
|
+
internals.fetch(name, nil)
|
25
|
+
end
|
26
|
+
|
27
|
+
def assign_output(name, value)
|
28
|
+
assign_attribute(:outputs, name, value)
|
29
|
+
end
|
30
|
+
|
31
|
+
def fetch_output(name)
|
32
|
+
outputs.fetch(name, nil)
|
33
|
+
end
|
34
|
+
|
35
|
+
def inputs
|
36
|
+
@inputs ||= context_data.fetch(:inputs)
|
37
|
+
end
|
38
|
+
|
39
|
+
def internals
|
40
|
+
@internals ||= context_data.fetch(:internals)
|
41
|
+
end
|
42
|
+
|
43
|
+
def outputs
|
44
|
+
@outputs ||= context_data.fetch(:outputs)
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def assign_attribute(section, name, value)
|
50
|
+
context_data[section].assign(name, value)
|
51
|
+
end
|
52
|
+
|
53
|
+
def context_data
|
54
|
+
@context_data ||= state.fetch(context_id)
|
55
|
+
end
|
56
|
+
|
57
|
+
def state
|
58
|
+
{
|
59
|
+
context_id => {
|
60
|
+
inputs: Servactory::Context::Warehouse::Inputs.new(@context),
|
61
|
+
internals: Servactory::Context::Warehouse::Internals.new,
|
62
|
+
outputs: Servactory::Context::Warehouse::Outputs.new
|
63
|
+
}
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
def context_id
|
68
|
+
@context_id ||= "context_#{@context.object_id}"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -7,9 +7,8 @@ module Servactory
|
|
7
7
|
RESERVED_ATTRIBUTES = %i[type required default].freeze
|
8
8
|
private_constant :RESERVED_ATTRIBUTES
|
9
9
|
|
10
|
-
def initialize(context:,
|
10
|
+
def initialize(context:, collection_of_inputs:)
|
11
11
|
@context = context
|
12
|
-
@incoming_arguments = incoming_arguments
|
13
12
|
@collection_of_inputs = collection_of_inputs
|
14
13
|
end
|
15
14
|
|
@@ -41,7 +40,7 @@ module Servactory
|
|
41
40
|
|
42
41
|
private
|
43
42
|
|
44
|
-
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize,
|
43
|
+
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Lint/UnusedMethodArgument
|
45
44
|
def fetch_with(name:, &block)
|
46
45
|
input_name = @context.class.config.predicate_methods_enabled? ? name.to_s.chomp("?").to_sym : name
|
47
46
|
|
@@ -49,7 +48,7 @@ module Servactory
|
|
49
48
|
|
50
49
|
return yield if input.nil?
|
51
50
|
|
52
|
-
input_value = @
|
51
|
+
input_value = @context.send(:servactory_service_warehouse).fetch_input(input.name)
|
53
52
|
input_value = input.default if input.optional? && input_value.blank?
|
54
53
|
|
55
54
|
if input.hash_mode? && (tmp_schema = input.schema.fetch(:is)).present?
|
@@ -65,7 +64,7 @@ module Servactory
|
|
65
64
|
input_value
|
66
65
|
end
|
67
66
|
end
|
68
|
-
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize,
|
67
|
+
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Lint/UnusedMethodArgument
|
69
68
|
|
70
69
|
def prepare_hash_values_inside(object:, schema:) # rubocop:disable Metrics/MethodLength
|
71
70
|
return object unless object.respond_to?(:fetch)
|
@@ -50,7 +50,7 @@ module Servactory
|
|
50
50
|
value:
|
51
51
|
)
|
52
52
|
|
53
|
-
@context.send(:
|
53
|
+
@context.send(:servactory_service_warehouse).assign_internal(internal.name, value)
|
54
54
|
end
|
55
55
|
|
56
56
|
def fetch_with(name:, &block) # rubocop:disable Metrics/AbcSize, Lint/UnusedMethodArgument
|
@@ -59,7 +59,7 @@ module Servactory
|
|
59
59
|
|
60
60
|
return yield if internal.nil?
|
61
61
|
|
62
|
-
internal_value = @context.send(:
|
62
|
+
internal_value = @context.send(:servactory_service_warehouse).fetch_internal(internal.name)
|
63
63
|
|
64
64
|
if name.to_s.end_with?("?") && @context.class.config.predicate_methods_enabled?
|
65
65
|
Servactory::Utils.query_attribute(internal_value)
|
@@ -50,7 +50,7 @@ module Servactory
|
|
50
50
|
value:
|
51
51
|
)
|
52
52
|
|
53
|
-
@context.send(:
|
53
|
+
@context.send(:servactory_service_warehouse).assign_output(output.name, value)
|
54
54
|
end
|
55
55
|
|
56
56
|
def fetch_with(name:, &block) # rubocop:disable Metrics/AbcSize, Lint/UnusedMethodArgument
|
@@ -59,7 +59,7 @@ module Servactory
|
|
59
59
|
|
60
60
|
return yield if output.nil?
|
61
61
|
|
62
|
-
output_value = @context.send(:
|
62
|
+
output_value = @context.send(:servactory_service_warehouse).fetch_output(output.name)
|
63
63
|
|
64
64
|
if name.to_s.end_with?("?") && @context.class.config.predicate_methods_enabled?
|
65
65
|
Servactory::Utils.query_attribute(output_value)
|
@@ -23,7 +23,6 @@ module Servactory
|
|
23
23
|
def inputs
|
24
24
|
@inputs ||= Inputs.new(
|
25
25
|
context: self,
|
26
|
-
incoming_arguments:,
|
27
26
|
collection_of_inputs:
|
28
27
|
)
|
29
28
|
end
|
@@ -83,8 +82,7 @@ module Servactory
|
|
83
82
|
|
84
83
|
private
|
85
84
|
|
86
|
-
attr_reader :
|
87
|
-
:collection_of_inputs,
|
85
|
+
attr_reader :collection_of_inputs,
|
88
86
|
:collection_of_internals,
|
89
87
|
:collection_of_outputs
|
90
88
|
|
@@ -105,13 +103,11 @@ module Servactory
|
|
105
103
|
end
|
106
104
|
|
107
105
|
def call!(
|
108
|
-
incoming_arguments:,
|
109
106
|
collection_of_inputs:,
|
110
107
|
collection_of_internals:,
|
111
108
|
collection_of_outputs:,
|
112
109
|
**
|
113
110
|
)
|
114
|
-
@incoming_arguments = incoming_arguments
|
115
111
|
@collection_of_inputs = collection_of_inputs
|
116
112
|
@collection_of_internals = collection_of_internals
|
117
113
|
@collection_of_outputs = collection_of_outputs
|
@@ -130,8 +126,8 @@ module Servactory
|
|
130
126
|
@servactory_service_info ||= self.class::Actor.new(self)
|
131
127
|
end
|
132
128
|
|
133
|
-
def
|
134
|
-
@
|
129
|
+
def servactory_service_warehouse
|
130
|
+
@servactory_service_warehouse ||= Warehouse::Setup.new(self)
|
135
131
|
end
|
136
132
|
end
|
137
133
|
end
|
@@ -8,9 +8,8 @@ module Servactory
|
|
8
8
|
new(...).find!
|
9
9
|
end
|
10
10
|
|
11
|
-
def initialize(context,
|
11
|
+
def initialize(context, collection_of_inputs)
|
12
12
|
@context = context
|
13
|
-
@incoming_arguments = incoming_arguments
|
14
13
|
@collection_of_inputs = collection_of_inputs
|
15
14
|
end
|
16
15
|
|
@@ -31,7 +30,9 @@ module Servactory
|
|
31
30
|
private
|
32
31
|
|
33
32
|
def unnecessary_attributes
|
34
|
-
@unnecessary_attributes ||=
|
33
|
+
@unnecessary_attributes ||=
|
34
|
+
@context.send(:servactory_service_warehouse).inputs.names -
|
35
|
+
@collection_of_inputs.names
|
35
36
|
end
|
36
37
|
end
|
37
38
|
end
|
@@ -8,9 +8,8 @@ module Servactory
|
|
8
8
|
new(...).validate!
|
9
9
|
end
|
10
10
|
|
11
|
-
def initialize(context,
|
11
|
+
def initialize(context, collection_of_inputs)
|
12
12
|
@context = context
|
13
|
-
@incoming_arguments = incoming_arguments
|
14
13
|
@collection_of_inputs = collection_of_inputs
|
15
14
|
end
|
16
15
|
|
@@ -52,7 +51,7 @@ module Servactory
|
|
52
51
|
validation_class.check(
|
53
52
|
context: @context,
|
54
53
|
attribute: input,
|
55
|
-
value: @
|
54
|
+
value: @context.send(:servactory_service_warehouse).fetch_input(input.name),
|
56
55
|
check_key:,
|
57
56
|
check_options:
|
58
57
|
)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Servactory
|
4
|
+
module Inputs
|
5
|
+
module Tools
|
6
|
+
class Warehouse
|
7
|
+
def self.assign(...)
|
8
|
+
new(...).assign
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(context, incoming_arguments)
|
12
|
+
@context = context
|
13
|
+
@incoming_arguments = incoming_arguments
|
14
|
+
end
|
15
|
+
|
16
|
+
def assign
|
17
|
+
@context.send(:servactory_service_warehouse).assign_inputs(adapted_arguments)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def adapted_arguments
|
23
|
+
Servactory::Utils.adapt(@incoming_arguments)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -5,12 +5,14 @@ module Servactory
|
|
5
5
|
module Workspace
|
6
6
|
private
|
7
7
|
|
8
|
-
def call!(incoming_arguments:,
|
8
|
+
def call!(incoming_arguments:, **)
|
9
9
|
super
|
10
10
|
|
11
|
-
Tools::
|
11
|
+
Tools::Warehouse.assign(self, incoming_arguments)
|
12
|
+
|
13
|
+
Tools::Unnecessary.find!(self, collection_of_inputs)
|
12
14
|
Tools::Rules.check!(self, collection_of_inputs)
|
13
|
-
Tools::Validation.validate!(self,
|
15
|
+
Tools::Validation.validate!(self, collection_of_inputs)
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
@@ -108,12 +108,12 @@ module Servactory
|
|
108
108
|
return if @define_methods.blank?
|
109
109
|
|
110
110
|
@define_methods_template ||= @define_methods.map do |define_method|
|
111
|
-
<<-RUBY
|
112
|
-
def #{define_method.name}
|
113
|
-
#{define_method.content.call(option: @body)}
|
111
|
+
<<-RUBY.squish
|
112
|
+
def #{define_method.name};
|
113
|
+
#{define_method.content.call(option: @body)};
|
114
114
|
end
|
115
115
|
RUBY
|
116
|
-
end.join("
|
116
|
+
end.join("; ")
|
117
117
|
end
|
118
118
|
end
|
119
119
|
end
|
data/lib/servactory/result.rb
CHANGED
@@ -116,7 +116,7 @@ module Servactory
|
|
116
116
|
|
117
117
|
def outputs
|
118
118
|
@outputs ||= Outputs.new(
|
119
|
-
outputs: @context.send(:
|
119
|
+
outputs: @context.send(:servactory_service_warehouse).outputs,
|
120
120
|
predicate_methods_enabled: if @context.is_a?(Servactory::TestKit::Result)
|
121
121
|
true
|
122
122
|
else
|
@@ -17,7 +17,7 @@ module Servactory
|
|
17
17
|
|
18
18
|
def initialize(attributes = {})
|
19
19
|
attributes.each_pair do |name, value|
|
20
|
-
|
20
|
+
servactory_service_warehouse.assign_output(name, value)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -25,8 +25,8 @@ module Servactory
|
|
25
25
|
|
26
26
|
private
|
27
27
|
|
28
|
-
def
|
29
|
-
@
|
28
|
+
def servactory_service_warehouse
|
29
|
+
@servactory_service_warehouse ||= Servactory::Context::Warehouse::Setup.new(self)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
data/lib/servactory/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: servactory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.12.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Sokolov
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-08 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: activesupport
|
@@ -190,14 +189,14 @@ dependencies:
|
|
190
189
|
requirements:
|
191
190
|
- - ">="
|
192
191
|
- !ruby/object:Gem::Version
|
193
|
-
version: '0.
|
192
|
+
version: '0.5'
|
194
193
|
type: :development
|
195
194
|
prerelease: false
|
196
195
|
version_requirements: !ruby/object:Gem::Requirement
|
197
196
|
requirements:
|
198
197
|
- - ">="
|
199
198
|
- !ruby/object:Gem::Version
|
200
|
-
version: '0.
|
199
|
+
version: '0.5'
|
201
200
|
- !ruby/object:Gem::Dependency
|
202
201
|
name: steep
|
203
202
|
requirement: !ruby/object:Gem::Requirement
|
@@ -250,7 +249,11 @@ files:
|
|
250
249
|
- lib/servactory/configuration/setup.rb
|
251
250
|
- lib/servactory/context/callable.rb
|
252
251
|
- lib/servactory/context/dsl.rb
|
253
|
-
- lib/servactory/context/
|
252
|
+
- lib/servactory/context/warehouse/base.rb
|
253
|
+
- lib/servactory/context/warehouse/inputs.rb
|
254
|
+
- lib/servactory/context/warehouse/internals.rb
|
255
|
+
- lib/servactory/context/warehouse/outputs.rb
|
256
|
+
- lib/servactory/context/warehouse/setup.rb
|
254
257
|
- lib/servactory/context/workspace.rb
|
255
258
|
- lib/servactory/context/workspace/inputs.rb
|
256
259
|
- lib/servactory/context/workspace/internals.rb
|
@@ -271,6 +274,7 @@ files:
|
|
271
274
|
- lib/servactory/inputs/tools/rules.rb
|
272
275
|
- lib/servactory/inputs/tools/unnecessary.rb
|
273
276
|
- lib/servactory/inputs/tools/validation.rb
|
277
|
+
- lib/servactory/inputs/tools/warehouse.rb
|
274
278
|
- lib/servactory/inputs/translator/required.rb
|
275
279
|
- lib/servactory/inputs/validations/base.rb
|
276
280
|
- lib/servactory/inputs/validations/errors.rb
|
@@ -334,7 +338,6 @@ metadata:
|
|
334
338
|
bug_tracker_uri: https://github.com/servactory/servactory/issues
|
335
339
|
changelog_uri: https://github.com/servactory/servactory/blob/master/CHANGELOG.md
|
336
340
|
rubygems_mfa_required: 'true'
|
337
|
-
post_install_message:
|
338
341
|
rdoc_options: []
|
339
342
|
require_paths:
|
340
343
|
- lib
|
@@ -349,8 +352,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
349
352
|
- !ruby/object:Gem::Version
|
350
353
|
version: '0'
|
351
354
|
requirements: []
|
352
|
-
rubygems_version: 3.
|
353
|
-
signing_key:
|
355
|
+
rubygems_version: 3.6.2
|
354
356
|
specification_version: 4
|
355
357
|
summary: A set of tools for building reliable services of any complexity
|
356
358
|
test_files: []
|
@@ -1,58 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Servactory
|
4
|
-
module Context
|
5
|
-
class Store
|
6
|
-
def initialize(context)
|
7
|
-
@context = context
|
8
|
-
end
|
9
|
-
|
10
|
-
def fetch_internal(name)
|
11
|
-
internals.fetch(name, nil)
|
12
|
-
end
|
13
|
-
|
14
|
-
def assign_internal(name, value)
|
15
|
-
assign_attribute(:internals, name, value)
|
16
|
-
end
|
17
|
-
|
18
|
-
def fetch_output(name)
|
19
|
-
outputs.fetch(name, nil)
|
20
|
-
end
|
21
|
-
|
22
|
-
def assign_output(name, value)
|
23
|
-
assign_attribute(:outputs, name, value)
|
24
|
-
end
|
25
|
-
|
26
|
-
def outputs
|
27
|
-
@outputs ||= context_data.fetch(:outputs)
|
28
|
-
end
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
def assign_attribute(section, name, value)
|
33
|
-
context_data[section].merge!({ name => value })
|
34
|
-
end
|
35
|
-
|
36
|
-
def internals
|
37
|
-
@internals ||= context_data.fetch(:internals)
|
38
|
-
end
|
39
|
-
|
40
|
-
def context_data
|
41
|
-
@context_data ||= state.fetch(context_id)
|
42
|
-
end
|
43
|
-
|
44
|
-
def state
|
45
|
-
{
|
46
|
-
context_id => {
|
47
|
-
internals: {},
|
48
|
-
outputs: {}
|
49
|
-
}
|
50
|
-
}
|
51
|
-
end
|
52
|
-
|
53
|
-
def context_id
|
54
|
-
@context_id ||= "context_#{@context.object_id}"
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|