class OvirtSDK4::SshReader
Public Class Methods
read_many(reader)
click to toggle source
# File lib/ovirtsdk4/readers.rb, line 16829 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 16765 def self.read_one(reader) # Do nothing if there aren't more tags: return nil unless reader.forward # Create the object: object = Ssh.new # Process the attributes: object.href = reader.get_attribute('href') value = reader.get_attribute('authentication_method') object.authentication_method = value if not value.nil? value = reader.get_attribute('comment') object.comment = value if not value.nil? value = reader.get_attribute('description') object.description = value if not value.nil? value = reader.get_attribute('fingerprint') object.fingerprint = value if not value.nil? value = reader.get_attribute('id') object.id = value if not value.nil? value = reader.get_attribute('name') object.name = value if not value.nil? value = reader.get_attribute('port') object.port = value if not value.nil? value = reader.get_attribute('public_key') object.public_key = value if not value.nil? # 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 'authentication_method' object.authentication_method = Reader.read_enum(SshAuthenticationMethod, reader) when 'comment' object.comment = Reader.read_string(reader) when 'description' object.description = Reader.read_string(reader) when 'fingerprint' object.fingerprint = Reader.read_string(reader) when 'id' object.id = Reader.read_string(reader) when 'name' object.name = Reader.read_string(reader) when 'port' object.port = Reader.read_integer(reader) when 'public_key' object.public_key = Reader.read_string(reader) when 'user' object.user = UserReader.read_one(reader) else reader.next_element end end # Discard the end tag: reader.read return object end