Class: Gitlab::Graphql::Loaders::BatchRootStorageStatisticsLoader
- Inherits:
-
Object
- Object
- Gitlab::Graphql::Loaders::BatchRootStorageStatisticsLoader
- Defined in:
- lib/gitlab/graphql/loaders/batch_root_storage_statistics_loader.rb
Instance Attribute Summary collapse
-
#namespace_id ⇒ Object
readonly
Returns the value of attribute namespace_id.
Instance Method Summary collapse
- #find ⇒ Object
-
#initialize(namespace_id) ⇒ BatchRootStorageStatisticsLoader
constructor
A new instance of BatchRootStorageStatisticsLoader.
Constructor Details
#initialize(namespace_id) ⇒ BatchRootStorageStatisticsLoader
Returns a new instance of BatchRootStorageStatisticsLoader.
9 10 11 |
# File 'lib/gitlab/graphql/loaders/batch_root_storage_statistics_loader.rb', line 9 def initialize(namespace_id) @namespace_id = namespace_id end |
Instance Attribute Details
#namespace_id ⇒ Object (readonly)
Returns the value of attribute namespace_id.
7 8 9 |
# File 'lib/gitlab/graphql/loaders/batch_root_storage_statistics_loader.rb', line 7 def namespace_id @namespace_id end |
Instance Method Details
#find ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/gitlab/graphql/loaders/batch_root_storage_statistics_loader.rb', line 13 def find BatchLoader::GraphQL.for(namespace_id).batch do |namespace_ids, loader| Namespace::RootStorageStatistics.for_namespace_ids(namespace_ids).each do |statistics| loader.call(statistics.namespace_id, statistics) end end end |