Class: CephRuby::PoolEnumerator

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/ceph-ruby/pool_enumerator.rb

Overview

Enumerator of Ceph pools

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cluster) {|_self| ... } ⇒ PoolEnumerator

Returns a new instance of PoolEnumerator.

Yields:

  • (_self)

Yield Parameters:



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

#clusterObject

Returns the value of attribute cluster.



5
6
7
# File 'lib/ceph-ruby/pool_enumerator.rb', line 5

def cluster
  @cluster
end

#membersObject

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

#eachObject



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

#sizeObject



19
20
21
# File 'lib/ceph-ruby/pool_enumerator.rb', line 19

def size
  pools.size
end