Module: FogExtensions::Proxmox::Node

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/fog_extensions/proxmox/node.rb

Instance Method Summary collapse

Instance Method Details

#each(collection_filters = {}, &block) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/models/concerns/fog_extensions/proxmox/node.rb', line 25

def each(collection_filters = {}, &block)
  if block_given?
    Kernel.loop do
      break unless collection_filters[:marker]

      page = all(collection_filters)
      # We need to explicitly use the base 'each' method here on the page,
      #  otherwise we get infinite recursion
      base_each = Fog::Collection.instance_method(:each)
      base_each.bind(page).call(&block)
    end
  end
  self
end