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

#all(options = {}) ⇒ Object



24
25
26
27
28
# File 'app/models/concerns/fog_extensions/proxmox/node.rb', line 24

def all(options = {})
    vms = servers.all 
    vms += containers.all
    vms
end

#each(collection_filters = {}) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/models/concerns/fog_extensions/proxmox/node.rb', line 29

def each(collection_filters = {})
    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 { |item| yield item }
    end
    end
    self
end