Class: WelltreatStoreFramework::StoreApp::AppStack

Inherits:
Object
  • Object
show all
Defined in:
lib/welltreat_store_framework/store_app.rb

Overview

Provide utilities for bootstrapping new app stack

Class Method Summary collapse

Class Method Details

.generate_partition_object_getter(store, _modules) ⇒ Object



256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/welltreat_store_framework/store_app.rb', line 256

def generate_partition_object_getter(store, _modules)
  if store.partition_object
    _modules.each do |_mod|
      _mod.constants.each do |_const|
        _class = _mod.const_get(_const)
        if _class.respond_to?(:set_flexi_partition_id)
          _class.send(:set_flexi_partition_id, store.partition_object.id)
        end
      end
    end
  end
end

.load_classes(_mod, _path) ⇒ Object



269
270
271
272
273
274
275
276
277
# File 'lib/welltreat_store_framework/store_app.rb', line 269

def load_classes(_mod, _path)
  if _path.match(/\.rb$/)
    _mod.module_eval File.read(_path), _path, 0
  else
    Dir.glob(File.join(_path, "*.rb")).each do |_file|
      _mod.module_eval File.read(_file), _file, 0
    end
  end
end