Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
PStore#[]=
(K name, V value) -> V
[]=(key, value)
lib/pstore.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/pstore.rb, line 459
def []=(key, value)
in_transaction_wr
@table[key] = value
end
Creates or replaces the value for the given key:
Example
example_store do |store| temp.transaction do temp[:bat] = 3 end end
See also Hierarchical Values.
Raises an exception if called outside a transaction block.