def end_element(name)
case name
when "access_method"
@device["access_methods"] << @access_method
when "architecture"
@device["operating_system"][name] = value.to_i
when "cage", "facility", "rack", "row", "zone"
@device["location"][name]["value"] = value
when "cores"
@device["processor"][name] = value.to_i
when "description"
@device[name] = value
when "device"
@response["devices"] << @device
@device = {}
when "drive"
@device["drives"] << @drive
@drive = {}
when "cores"
@device["processing_cores"] = value.to_i
when "ipassignment"
@device["ipassignments"].last["value"] = value
when "model", "type"
@device[name]["value"] = value
when "name"
@device["operating_system"][name] = value
when "position"
@device["location"][name] = value
when "power_consumption"
@device[name] = [value, @device[name]].join(" ")
when "size"
@drive[name] = value.to_i
when "host", "password", "protocol", "username"
@access_method[name] = value
end
end