lib/fog/vsphere/requests/compute/list_virtual_machines.rb
def folder_enumerator(raw_folder, recursive)
          Enumerator.new do |yielder|
            raw_folder.children.each do |child|
              case child
              when RbVmomi::VIM::Folder
                folder_enumerator(child, true).each { |item| yielder.yield item } if recursive
              when RbVmomi::VIM::VirtualMachine
                yielder.yield child
              end
            end
          end
        end
# An enumerator for a folder. Enumerates all the VMs in the folder, recursively if
# passed recursive=true
An enumerator for a folder. Enumerates all the VMs in the folder, recursively if
passed recursive=true
An enumerator for a folder . Enumerates all the VMs in the folder recursively if passed recursive = true
def folder_enumerator(raw_folder, recursive)
          Enumerator.new do |yielder|
            raw_folder.children.each do |child|
              case child
              when RbVmomi::VIM::Folder
                folder_enumerator(child, true).each { |item| yielder.yield item } if recursive
              when RbVmomi::VIM::VirtualMachine
                yielder.yield child
              end
            end
          end
        end
def folder_enumerator ( raw_folder , recursive ) Enumerator . new do | yielder | raw_folder . children . each do | child | case child when RbVmomi :: VIM :: Folder folder_enumerator ( child , true ) . each { | item | yielder . yield item } if recursive when RbVmomi :: VIM :: VirtualMachine yielder . yield child end end end end
An enumerator for a folder.
An enumerator for a folder .
raw_folder
recursive