Class: LUSI::API::Person::UserContact

Inherits:
Object
  • Object
show all
Defined in:
lib/lusi_api/person/student.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameString?



194
195
196
# File 'lib/lusi_api/person/student.rb', line 194

def contact_name
  @contact_name
end

#contact_typeString?



190
191
192
# File 'lib/lusi_api/person/student.rb', line 190

def contact_type
  @contact_type
end

#email_addressString?



198
199
200
# File 'lib/lusi_api/person/student.rb', line 198

def email_address
  @email_address
end

#identityString?



186
187
188
# File 'lib/lusi_api/person/student.rb', line 186

def identity
  @identity
end

Instance Method Details

#to_sString

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