Class: StrokeDB::HashSlotValue

Inherits:
LazyMappingHash show all
Defined in:
lib/document/slot.rb

Instance Method Summary collapse

Methods inherited from LazyMappingHash

#[], #_each, #_keys, #_square_brackets, #_square_brackets_set, #_values, #class, #each, #initialize, #keys, #map_with, #unmap_with, #values

Methods inherited from Hash

#_stroke_split_merge_result, #except, #reverse_merge, #reverse_merge!, #stringify_keys, #stroke_diff, #stroke_merge, #stroke_patch

Constructor Details

This class inherits a constructor from StrokeDB::LazyMappingHash

Instance Method Details

#[]=(*args) ⇒ Object



7
8
9
10
# File 'lib/document/slot.rb', line 7

def []=(*args)
  super(*args)
  @modification_callback.call if @modification_callback
end

#with_modification_callback(&block) ⇒ Object



3
4
5
6
# File 'lib/document/slot.rb', line 3

def with_modification_callback(&block)
  @modification_callback = block
  self
end