Method: Fog::Hyperv::ModelIncludes#parent

Defined in:
lib/fog/model.rb

#parentObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fog/model.rb', line 21

def parent
  return @vm if @vm
  return @computer if @computer
  return @cluster if @cluster
  return nil unless collection
  return collection.vm if collection.attributes.include? :vm
  return collection.computer if collection.attributes.include? :computer
  @parent ||= begin
    r = service.servers.get vm_name if attributes.include? :vm_name
    r = service.hosts.get computer_name if attributes.include? :computer_name
    r
  end
end