Method: Fog::Parsers::Terremark::Shared::GetVdc#end_element

Defined in:
lib/fog/terremark/parsers/shared/get_vdc.rb

#end_element(name) ⇒ Object


89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/fog/terremark/parsers/shared/get_vdc.rb', line 89

def end_element(name)
  case name
  when 'Allocated', 'Limit', 'Units', 'Used'
    if @in_cpu
      @response['ComputeCapacity']['Cpu'][name] = value
    elsif @in_deployed_vms_quota
      @response['ComputeCapacity']['DeployedVmsQuota'][name] = value
    elsif @in_instantiated_vms_quota
      @response['ComputeCapacity']['InstantiatedVmsQuota'][name] = value
    elsif @in_memory
      @response['ComputeCapacity']['Memory'][name] = value
    elsif @in_storage_capacity
      @response['StorageCapacity'][name] = value
    end
  when 'Cpu'
    @in_cpu = false
  when 'DeployedVmsQuota'
    @in_deployed_vms_quota = false
  when 'InstantiatedVmsQuota'
    @in_instantiated_vms_quota = false
  when 'Memory'
    @in_memory = false
  when 'StorageCapacity'
    @in_storage_capacity = false
  when 'Type'
    @response[name] = value
  end
end