Method: RbVmomi::VIM::ManagedObject#collect

Defined in:
lib/rbvmomi/vim/ManagedObject.rb

#collect(*pathSet) {|*values| ... } ⇒ Array

Efficiently retrieve multiple properties from an object.

Parameters:

  • pathSet (Array)

    Properties to return.

Yields:

  • (*values)

    Property values in same order as pathSet.

Returns:

  • (Array)

    Property values in same order as pathSet, or the return value from the block if it is given.



54
55
56
57
58
59
60
61
62
# File 'lib/rbvmomi/vim/ManagedObject.rb', line 54

def collect *pathSet
  h = collect!(*pathSet)
  a = pathSet.map { |k| h[k.to_s] }
  if block_given?
    yield a
  else
    a
  end
end