class RbVmomi::BasicTypes::ManagedObject

Public Class Methods

kind() click to toggle source
# File lib/rbvmomi/basic_types.rb, line 187
def self.kind; :managed end
new(connection, ref) click to toggle source
Calls superclass method
# File lib/rbvmomi/basic_types.rb, line 189
def initialize connection, ref
  super()
  @connection = connection
  @soap = @connection # XXX deprecated
  @ref = ref
end

Public Instance Methods

==(x) click to toggle source
# File lib/rbvmomi/basic_types.rb, line 248
def == x
  out = (x.class == self.class && x._ref == @ref)
  out = (x._connection.instanceUuid == self._connection.instanceUuid) if out && x._connection.host
  out
end
Also aliased as: eql?
[](k) click to toggle source
# File lib/rbvmomi/basic_types.rb, line 244
def [] k
  _get_property k
end
_call(method, o={}) click to toggle source
# File lib/rbvmomi/basic_types.rb, line 225
def _call method, o={}
  raise 'parameters must be passed as a hash' unless o.is_a? Hash

  desc = self.class.full_methods_desc[method.to_s] or raise 'unknown method'
  @connection.call method, desc, self, o
end
_connection() click to toggle source
# File lib/rbvmomi/basic_types.rb, line 196
def _connection
  @connection
end
_get_property(sym) click to toggle source
# File lib/rbvmomi/basic_types.rb, line 204
def _get_property sym
  ret = @connection.propertyCollector.RetrieveProperties(specSet: [{
    propSet: [{ type: self.class.wsdl_name, pathSet: [sym.to_s] }],
    objectSet: [{ obj: self }],
  }])[0]

  if !ret
    return nil
  elsif ret.propSet.empty?
    return nil if ret.missingSet.empty?

    raise ret.missingSet[0].fault
  else
    ret.propSet[0].val
  end
end
_ref() click to toggle source
# File lib/rbvmomi/basic_types.rb, line 200
def _ref
  @ref
end
_set_property(sym, val) click to toggle source
# File lib/rbvmomi/basic_types.rb, line 221
def _set_property sym, val
  raise 'unimplemented'
end
eql?(x)
Alias for: ==
hash() click to toggle source
# File lib/rbvmomi/basic_types.rb, line 256
def hash
  [self.class, @ref].hash
end
pretty_print(pp) click to toggle source
# File lib/rbvmomi/basic_types.rb, line 240
def pretty_print pp
  pp.text to_s
end
to_hash() click to toggle source
# File lib/rbvmomi/basic_types.rb, line 236
def to_hash
  to_s
end
to_s() click to toggle source
# File lib/rbvmomi/basic_types.rb, line 232
def to_s
  "#{self.class.wsdl_name}(#{@ref.inspect})"
end