class OvirtSDK4::RegistrationConfigurationReader

Public Class Methods

read_many(reader) click to toggle source
# File lib/ovirtsdk4/readers.rb, line 15106
def self.read_many(reader)
  # Do nothing if there aren't more tags:
  list = List.new
  return list unless reader.forward
  
  # Process the attributes:
  list.href = reader.get_attribute('href')
  
  # Discard the start tag:
  empty = reader.empty_element?
  reader.read
  return list if empty
  
  # Process the inner elements:
  while reader.forward do
    list << read_one(reader)
  end
  
  # Discard the end tag:
  reader.read
  
  return list
end
read_one(reader) click to toggle source
# File lib/ovirtsdk4/readers.rb, line 15062
def self.read_one(reader)
  # Do nothing if there aren't more tags:
  return nil unless reader.forward
  
  # Create the object:
  object = RegistrationConfiguration.new
  
  # Process the attributes:
  object.href = reader.get_attribute('href')
  
  # Discard the start tag:
  empty = reader.empty_element?
  reader.read
  return object if empty
  
  # Process the inner elements:
  while reader.forward do
    case reader.node_name
    when 'affinity_group_mappings'
      object.affinity_group_mappings = RegistrationAffinityGroupMappingReader.read_many(reader)
    when 'affinity_label_mappings'
      object.affinity_label_mappings = RegistrationAffinityLabelMappingReader.read_many(reader)
    when 'cluster_mappings'
      object.cluster_mappings = RegistrationClusterMappingReader.read_many(reader)
    when 'domain_mappings'
      object.domain_mappings = RegistrationDomainMappingReader.read_many(reader)
    when 'lun_mappings'
      object.lun_mappings = RegistrationLunMappingReader.read_many(reader)
    when 'role_mappings'
      object.role_mappings = RegistrationRoleMappingReader.read_many(reader)
    when 'vnic_profile_mappings'
      object.vnic_profile_mappings = RegistrationVnicProfileMappingReader.read_many(reader)
    else
      reader.next_element
    end
  end
  
  # Discard the end tag:
  reader.read
  
  return object
end