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