Class: PoolRelatedIterator

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/warden/cognito/pool_related_iterator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&factory) ⇒ PoolRelatedIterator

Returns a new instance of PoolRelatedIterator.



6
7
8
# File 'lib/warden/cognito/pool_related_iterator.rb', line 6

def initialize(&factory)
  @factory = factory
end

Instance Attribute Details

#factoryObject (readonly)

Returns the value of attribute factory.



4
5
6
# File 'lib/warden/cognito/pool_related_iterator.rb', line 4

def factory
  @factory
end

Instance Method Details

#each(&block) ⇒ Object



10
11
12
13
14
# File 'lib/warden/cognito/pool_related_iterator.rb', line 10

def each(&block)
  Warden::Cognito.config.user_pools.each do |pool|
    block.call factory.call(pool)
  end
end