Module: Serega::SeregaPlugins::Batch::SeregaBatchLoaders::InstanceMethods
- Included in:
- Serega::SeregaPlugins::Batch::SeregaBatchLoaders
- Defined in:
- lib/serega/plugins/batch/lib/loaders.rb
Overview
BatchLoaders instance methods
Instance Method Summary collapse
-
#get(map_point, object_serializer) ⇒ Serega::SeregaPlugins::Batch::SeregaBatchLoader
Initializes or fetches already initialized batch loader.
-
#load_all ⇒ Object
Loads all registered batches and removes them from registered list.
Instance Method Details
#get(map_point, object_serializer) ⇒ Serega::SeregaPlugins::Batch::SeregaBatchLoader
Initializes or fetches already initialized batch loader
18 19 20 |
# File 'lib/serega/plugins/batch/lib/loaders.rb', line 18 def get(map_point, object_serializer) batch_loaders[map_point] ||= self.class.serializer_class::SeregaBatchLoader.new(object_serializer, map_point) end |
#load_all ⇒ Object
Loads all registered batches and removes them from registered list
25 26 27 28 29 30 31 |
# File 'lib/serega/plugins/batch/lib/loaders.rb', line 25 def load_all return unless defined?(@batch_loaders) while (_point, batch_loader = batch_loaders.shift) batch_loader.load end end |