Class: LUSI::API::Person::UserContact
- Inherits:
-
Object
- Object
- LUSI::API::Person::UserContact
- Defined in:
- lib/lusi_api/person/student.rb
Instance Attribute Summary collapse
-
#contact_name ⇒ String?
The name of the contact.
-
#contact_type ⇒ String?
The type of contact (‘Staff’ | ‘Student’).
-
#email_address ⇒ String?
The email address of the contact.
-
#identity ⇒ String?
The identity code of the contact.
Instance Method Summary collapse
-
#initialize(xml = nil, lookup = nil, identity: nil, contact_type: nil, contact_name: nil, email_address: nil) ⇒ void
constructor
Initialises a new UserContact instance.
-
#to_s ⇒ String
Returns a string representation of the instance.
Constructor Details
#initialize(xml = nil, lookup = nil, identity: nil, contact_type: nil, contact_name: nil, email_address: nil) ⇒ void
Initialises a new UserContact instance
206 207 208 209 210 211 |
# 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 |
Instance Attribute Details
#contact_name ⇒ String?
Returns the name of the contact.
194 195 196 |
# File 'lib/lusi_api/person/student.rb', line 194 def contact_name @contact_name end |
#contact_type ⇒ String?
Returns the type of contact (‘Staff’ | ‘Student’).
190 191 192 |
# File 'lib/lusi_api/person/student.rb', line 190 def contact_type @contact_type end |
#email_address ⇒ String?
Returns the email address of the contact.
198 199 200 |
# File 'lib/lusi_api/person/student.rb', line 198 def email_address @email_address end |
#identity ⇒ String?
Returns the identity code of the contact.
186 187 188 |
# File 'lib/lusi_api/person/student.rb', line 186 def identity @identity end |
Instance Method Details
#to_s ⇒ String
Returns a string representation of the instance
215 216 217 218 |
# File 'lib/lusi_api/person/student.rb', line 215 def to_s email = @email_address ? " <#{@email_address}>" : '' "#{@contact_name}#{@email}" end |