Class: Julewire::Core::Execution::ScopeSnapshot

Inherits:
Object
  • Object
show all
Defined in:
lib/julewire/core/execution/scope_snapshot.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#lineageObject (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_hashObject



41
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 41

def attributes_hash = Fields::FieldSet.deep_dup_owned(@attributes)

#carry_hashObject



39
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 39

def carry_hash = Fields::FieldSet.deep_dup_owned(@carry)

#context_hashObject



37
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 37

def context_hash = {}

#execution_hashObject



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_childObject



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_atObject



33
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 33

def finished_at; end

#frozen_execution_hashObject



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_hashObject



51
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 51

def frozen_labels_hash = (@frozen_labels_hash ||= Fields::Internal.frozen_owned_copy(@labels))

#idObject



27
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 27

def id = @execution[:id]

#labels_hashObject



45
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 45

def labels_hash = Fields::FieldSet.deep_dup_owned(@labels)

#metrics_hashObject



49
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 49

def metrics_hash = {}

#neutral_hashObject



43
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 43

def neutral_hash = Fields::FieldSet.deep_dup_owned(@neutral)

#parentObject



35
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 35

def parent; end

#started_atObject



31
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 31

def started_at; end

#summary_hashObject



47
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 47

def summary_hash = {}

#typeObject



29
# File 'lib/julewire/core/execution/scope_snapshot.rb', line 29

def type = @execution[:type]