Class: RbVmomi::VIM::ObjectContent

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

Instance Method Summary collapse

Instance Method Details

#[](k) ⇒ Object



339
340
341
# File 'lib/rbvmomi/extensions.rb', line 339

def [](k)
  to_hash[k]
end

#to_hashObject



352
353
354
# File 'lib/rbvmomi/extensions.rb', line 352

def to_hash
  @cached_hash ||= to_hash_uncached
end

#to_hash_uncachedObject



343
344
345
346
347
348
349
350
# File 'lib/rbvmomi/extensions.rb', line 343

def to_hash_uncached
  h = {}
  propSet.each do |x|
    fail if h.member? x.name
    h[x.name] = x.val
  end
  h
end