Class: SpecForge::Forge::Variables
- Inherits:
-
Hash
- Object
- Hash
- SpecForge::Forge::Variables
- Defined in:
- lib/spec_forge/forge/variables.rb
Overview
Hash-based storage for runtime variables
Manages both static (global) variables that persist across blueprints and dynamic variables that are cleared between blueprints. Static variables are restored when clear is called.
Instance Method Summary collapse
-
#clear ⇒ Variables
Clears dynamic variables while preserving static ones.
-
#initialize(static: {}, dynamic: {}) ⇒ Variables
constructor
Creates a new Variables hash with static and dynamic values.
Constructor Details
#initialize(static: {}, dynamic: {}) ⇒ Variables
Creates a new Variables hash with static and dynamic values
21 22 23 24 25 |
# File 'lib/spec_forge/forge/variables.rb', line 21 def initialize(static: {}, dynamic: {}) @static = static.deep_dup merge!(@static, dynamic.deep_dup) end |
Instance Method Details
#clear ⇒ Variables
Clears dynamic variables while preserving static ones
32 33 34 35 |
# File 'lib/spec_forge/forge/variables.rb', line 32 def clear super merge!(@static) end |