Class: Temporalio::Internal::Worker::WorkflowInstance::ExternallyImmutableHash
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Temporalio::Internal::Worker::WorkflowInstance::ExternallyImmutableHash
- Defined in:
- lib/temporalio/internal/worker/workflow_instance/externally_immutable_hash.rb
Overview
Delegator to a hash that does not allow external mutations. Used for memo.
Instance Method Summary collapse
- #_update {|new_hash| ... } ⇒ Object
-
#initialize(initial_hash) ⇒ ExternallyImmutableHash
constructor
A new instance of ExternallyImmutableHash.
Constructor Details
#initialize(initial_hash) ⇒ ExternallyImmutableHash
Returns a new instance of ExternallyImmutableHash.
9 10 11 |
# File 'lib/temporalio/internal/worker/workflow_instance/externally_immutable_hash.rb', line 9 def initialize(initial_hash) super(initial_hash.freeze) end |
Instance Method Details
#_update {|new_hash| ... } ⇒ Object
13 14 15 16 17 |
# File 'lib/temporalio/internal/worker/workflow_instance/externally_immutable_hash.rb', line 13 def _update(&) new_hash = __getobj__.dup yield new_hash __setobj__(new_hash.freeze) end |