class LUSI::API::Person::UserContact
Attributes
contact_name[RW]
@!attribute [rw] contact_name
@return [String, nil] the name of the contact
contact_type[RW]
@!attribute [rw] contact_type
@return [String, nil] the type of contact ('Staff' | 'Student')
email_address[RW]
@!attribute [rw] email_address
@return [String, nil] the email address of the contact
identity[RW]
@!attribute [rw] identity
@return [String, nil] the identity code of the contact
Public Class Methods
new(xml = nil, lookup = nil, identity: nil, contact_type: nil, contact_name: nil, email_address: nil)
click to toggle source
Initialises a new UserContact
instance @param identity [String, nil] the default identity code of the contact @param contact_type
[String, nil] the default contact type ('Staff' | 'Student') @param contact_name
[String, nil] the default contact name @param email_address
[String, nil] the default email address @return [void]
# File lib/lusi_api/person/student.rb, line 206 def initialize(xml = nil, lookup = nil, identity: nil, contact_type: nil, contact_name: nil, email_address: nil) @identity = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Identity', identity) @contact_type = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:ContactType', contact_type) @contact_name = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:ContactName', contact_name) @email_address = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:EmailAddress', email_address) end
Public Instance Methods
to_s()
click to toggle source
Returns a string representation of the instance @return [String] the string representation of the contact
# File lib/lusi_api/person/student.rb, line 215 def to_s email = @email_address ? " <#{@email_address}>" : '' "#{@contact_name}#{@email}" end