Class: Lutaml::Model::Store::LiveView

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/lutaml/model/store.rb

Overview

Array-shaped live view over a class's WeakMap bucket, for specs/debugging (refs_for used to expose the raw array).

Instance Method Summary collapse

Constructor Details

#initialize(store, model_key) ⇒ LiveView

Returns a new instance of LiveView.



224
225
226
227
# File 'lib/lutaml/model/store.rb', line 224

def initialize(store, model_key)
  @store = store
  @model_key = model_key
end

Instance Method Details

#each(&block) ⇒ Object



229
230
231
# File 'lib/lutaml/model/store.rb', line 229

def each(&block)
  @store.live_objects(@model_key).each(&block)
end

#sizeObject



233
234
235
# File 'lib/lutaml/model/store.rb', line 233

def size
  @store.live_objects(@model_key).size
end