Class: CephStorage::PoolEnumerator
- Inherits:
-
Object
- Object
- CephStorage::PoolEnumerator
- Includes:
- Enumerable
- Defined in:
- lib/ceph_storage/pool_enumerator.rb
Overview
Enumerator of Ceph pools
Instance Attribute Summary collapse
-
#cluster_factory ⇒ Object
Returns the value of attribute cluster_factory.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(cluster_factory) {|_self| ... } ⇒ PoolEnumerator
constructor
A new instance of PoolEnumerator.
- #size ⇒ Object
Constructor Details
#initialize(cluster_factory) {|_self| ... } ⇒ PoolEnumerator
Returns a new instance of PoolEnumerator.
6 7 8 9 10 |
# File 'lib/ceph_storage/pool_enumerator.rb', line 6 def initialize(cluster_factory) self.cluster_factory = cluster_factory @rados_pool_enumerator = cluster_factory.rados_cluster.pools yield self if block_given? end |
Instance Attribute Details
#cluster_factory ⇒ Object
Returns the value of attribute cluster_factory.
5 6 7 |
# File 'lib/ceph_storage/pool_enumerator.rb', line 5 def cluster_factory @cluster_factory end |
Instance Method Details
#each ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/ceph_storage/pool_enumerator.rb', line 12 def each return enum_for(:each) unless block_given? @rados_pool_enumerator.each do |pool| yield PoolFactory.build(cluster_factory, pool.name) end end |
#size ⇒ Object
20 21 22 |
# File 'lib/ceph_storage/pool_enumerator.rb', line 20 def size cluster.rados_cluster.pools.size end |