Module: Gitlab::CloudConnector::DataModel
- Defined in:
- lib/gitlab/cloud_connector/data_model.rb,
lib/gitlab/cloud_connector/data_model/base.rb,
lib/gitlab/cloud_connector/data_model/overridable.rb,
lib/gitlab/cloud_connector/data_model/associations.rb,
lib/gitlab/cloud_connector/data_model/yaml_data_loader.rb,
lib/gitlab/cloud_connector/data_model/abstract_data_loader.rb
Defined Under Namespace
Modules: Associations, Overridable Classes: AbstractDataLoader, AddOn, BackendService, Base, LicenseType, Service, UnitPrimitive, YamlDataLoader
Class Method Summary collapse
-
.load_all(loader_class: YamlDataLoader) ⇒ Object
Returns a hash of all data objects loaded from YAML files.
Class Method Details
.load_all(loader_class: YamlDataLoader) ⇒ Object
Returns a hash of all data objects loaded from YAML files.
11 12 13 14 15 16 17 |
# File 'lib/gitlab/cloud_connector/data_model.rb', line 11 def self.load_all(loader_class: YamlDataLoader) Base.subclasses.each_with_object({}) do |clazz, h| data_obj = loader_class.new(clazz).load_with_index! key = clazz.name.demodulize.pluralize.underscore.to_sym h[key] = data_obj.values.uniq.map(&:to_hash) end end |