Module: RbVmomi::BasicTypes::ObjectWithRefAndConnection

Included in:
ManagedObject, OpaqueObject
Defined in:
lib/rbvmomi/basic_types.rb

Instance Method Summary collapse

Instance Method Details

#==(x) ⇒ Object Also known as: eql?



213
214
215
216
217
# File 'lib/rbvmomi/basic_types.rb', line 213

def == x
  out = x.hash == hash
  out = (x._connection.instanceUuid == self._connection.instanceUuid) if out && x._connection.host
  out
end

#_connectionObject



193
194
195
# File 'lib/rbvmomi/basic_types.rb', line 193

def _connection
  @connection
end

#_refObject



197
198
199
# File 'lib/rbvmomi/basic_types.rb', line 197

def _ref
  @ref
end

#hashObject



221
222
223
# File 'lib/rbvmomi/basic_types.rb', line 221

def hash
  [self.class, @ref].hash
end

#initialize(connection, ref) ⇒ Object



186
187
188
189
190
191
# File 'lib/rbvmomi/basic_types.rb', line 186

def initialize connection, ref
  super()
  @connection = connection
  @soap = @connection # XXX deprecated
  @ref = ref
end

#pretty_print(pp) ⇒ Object



209
210
211
# File 'lib/rbvmomi/basic_types.rb', line 209

def pretty_print pp
  pp.text to_s
end

#to_hashObject



205
206
207
# File 'lib/rbvmomi/basic_types.rb', line 205

def to_hash
  to_s
end

#to_sObject



201
202
203
# File 'lib/rbvmomi/basic_types.rb', line 201

def to_s
  "#{self.class.wsdl_name}(#{@ref.inspect})"
end