Class: Julewire::Core::Execution::ScopeSnapshot
- Inherits:
-
Object
- Object
- Julewire::Core::Execution::ScopeSnapshot
- Defined in:
- lib/julewire/core/execution/scope_snapshot.rb
Instance Attribute Summary collapse
-
#lineage ⇒ Object
readonly
Returns the value of attribute lineage.
Instance Method Summary collapse
- #attributes_hash ⇒ Object
- #carry_hash ⇒ Object
- #context_hash ⇒ Object
- #execution_hash ⇒ Object
- #execution_reference_for_child ⇒ Object
- #finished_at ⇒ Object
- #frozen_execution_hash ⇒ Object
- #frozen_labels_hash ⇒ Object
- #id ⇒ Object
-
#initialize(execution: {}, carry: {}, attributes: {}, labels: {}, neutral: {}, lineage: nil, owned: false) ⇒ ScopeSnapshot
constructor
A new instance of ScopeSnapshot.
- #labels_hash ⇒ Object
- #metrics_hash ⇒ Object
- #neutral_hash ⇒ Object
- #parent ⇒ Object
- #started_at ⇒ Object
- #summary_hash ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(execution: {}, carry: {}, attributes: {}, labels: {}, neutral: {}, lineage: nil, owned: false) ⇒ ScopeSnapshot
Returns a new instance of ScopeSnapshot.
7 8 9 10 11 12 13 14 15 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 7 def initialize(execution: {}, carry: {}, attributes: {}, labels: {}, neutral: {}, lineage: nil, owned: false) @owned = owned @execution = normalized_hash(execution) @carry = normalized_hash(carry) @attributes = normalized_hash(attributes) @neutral = normalized_hash(neutral) @labels = normalized_hash(labels) @lineage = lineage || Lineage.from_execution_hash(@execution) end |
Instance Attribute Details
#lineage ⇒ Object (readonly)
Returns the value of attribute lineage.
25 26 27 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 25 def lineage @lineage end |
Instance Method Details
#attributes_hash ⇒ Object
41 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 41 def attributes_hash = Fields::FieldSet.deep_dup_owned(@attributes) |
#carry_hash ⇒ Object
39 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 39 def carry_hash = Fields::FieldSet.deep_dup_owned(@carry) |
#context_hash ⇒ Object
37 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 37 def context_hash = {} |
#execution_hash ⇒ Object
17 18 19 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 17 def execution_hash Fields::FieldSet.deep_dup_owned(frozen_execution_hash) end |
#execution_reference_for_child ⇒ Object
53 54 55 56 57 58 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 53 def execution_reference_for_child reference = {} reference[:type] = @execution.fetch(:type) if @execution.key?(:type) reference[:id] = @execution.fetch(:id) if @execution.key?(:id) Fields::Internal.frozen_copy(reference) unless reference.empty? end |
#finished_at ⇒ Object
33 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 33 def finished_at; end |
#frozen_execution_hash ⇒ Object
21 22 23 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 21 def frozen_execution_hash @frozen_execution_hash ||= Fields::Internal.frozen_owned_copy(@execution) end |
#frozen_labels_hash ⇒ Object
51 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 51 def frozen_labels_hash = (@frozen_labels_hash ||= Fields::Internal.frozen_owned_copy(@labels)) |
#id ⇒ Object
27 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 27 def id = @execution[:id] |
#labels_hash ⇒ Object
45 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 45 def labels_hash = Fields::FieldSet.deep_dup_owned(@labels) |
#metrics_hash ⇒ Object
49 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 49 def metrics_hash = {} |
#neutral_hash ⇒ Object
43 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 43 def neutral_hash = Fields::FieldSet.deep_dup_owned(@neutral) |
#parent ⇒ Object
35 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 35 def parent; end |
#started_at ⇒ Object
31 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 31 def started_at; end |
#summary_hash ⇒ Object
47 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 47 def summary_hash = {} |
#type ⇒ Object
29 |
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 29 def type = @execution[:type] |