Sha256: e9839f8a19e7dfc56db5d1ce9ddbeb8cfb3ee06cdb19b0f687d8ab733374fe4f

Contents?: true

Size: 904 Bytes

Versions: 22

Compression:

Stored size: 904 Bytes

Contents

# Stash API is useful for storing simple key/value pairs
# to preserve state between script runs
stash_set('key1', 'val1')
stash_set('key2', 'val2')
check_expression("'#{stash_get('key1')}' == 'val1'")
check_expression("'#{stash_get('key2')}' == 'val2'")
check_expression("'#{stash_keys().to_s}' == '[\"key1\", \"key2\"]'")
stash_set('key1', 1)
stash_set('key2', 2)
check_expression("'#{stash_all().to_s}' == '{\"key1\"=>1, \"key2\"=>2}'")
stash_delete('key2')
check_expression("#{stash_get('key2').nil?} == true")
stash_delete('key1')
data = [1,2,[3,4]]
stash_set('ary', data)
check_expression("'#{stash_get('ary')}' == '#{data.to_s}'")
stash_delete('ary')
# Note: hashes with symbol keys works but get converted to string keys on stash_get
hash = { 'one' => 1, 'two' => 2, 'string' => 'string' }
stash_set('hash', hash)
check_expression("'#{stash_get('hash')}' == '#{hash.to_s}'")
stash_delete('hash')

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
openc3-cosmos-demo-5.11.0 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.10.1 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.10.0 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.9.1 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.9.0 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.8.1 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.8.0 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.7.2 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.7.0 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.6.1 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.6.0 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.5.2 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.5.2.pre.beta0.20230315041141 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.5.1 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.5.0 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.5.0.pre.beta0.20230217010435 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.4.3.pre.beta0.20230214173509 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.4.2 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.4.1 targets/INST/procedures/stash.rb
openc3-cosmos-demo-5.4.0 targets/INST/procedures/stash.rb