Class: RbVmomi::VIM::ResourcePool

Inherits:
Object
  • Object
show all
Defined in:
lib/rbvmomi/vim/ResourcePool.rb

Instance Method Summary collapse

Instance Method Details

#find(name) ⇒ VIM::ResourcePool

Retrieve a child ResourcePool.

Parameters:

  • name (String)

    Name of the child.

Returns:



5
6
7
# File 'lib/rbvmomi/vim/ResourcePool.rb', line 5

def find name
  @soap.searchIndex.FindChild(:entity => self, :name => name)
end

#traverse(path) ⇒ VIM::ResourcePool

Retrieve a descendant of this ResourcePool.

Parameters:

  • path (String)

    Path delimited by ‘/’.

Returns:



12
13
14
15
16
17
# File 'lib/rbvmomi/vim/ResourcePool.rb', line 12

def traverse path
  es = path.split('/').reject(&:empty?)
  es.inject(self) do |f,e|
    f.find(e) || return
  end
end