Class: LUSI::API::Person::StudentRecord

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

Overview

Represents a student record in the LUSI API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml = nil, lookup = nil, identity: nil, external_institution_identity: nil, category: nil, college: nil, department: nil, attendance_status: nil, research_student: nil, programme_of_study: nil, scheme_of_study: nil, entry_date: nil, expected_completion_date: nil, year_of_study: nil, year_of_scheme_of_study: nil, modules: nil, relationships: nil, full_name_on_certificate: nil, leave_details: nil, user_account: nil) ⇒ void

Initialises a new StudentRecord instance

Parameters:

  • xml (Nokogiri::XML::Document, Nokogiri::XML::Node) (defaults to: nil)

    the parsed XML root of the student record

  • lookup (LUSI::API::Core::Lookup::LookupService, nil) (defaults to: nil)

    the lookup service for object resolution

  • identity (String, nil) (defaults to: nil)

    the default institutional registration identity code

  • external_institution_identity (String, nil) (defaults to: nil)

    the default external institution registration identity code

  • category (String, nil) (defaults to: nil)

    the default registration category (type)

  • college (String, nil) (defaults to: nil)

    the default associated college name

  • department (LUSI::API::Organisation::Unit, nil) (defaults to: nil)

    the default associated department

  • attendance_status (String, nil) (defaults to: nil)

    the default registration status

  • research_student (Boolean, nil) (defaults to: nil)

    the default value of the research student indicator flag

  • scheme_of_study (LUSI::API::Course::SchemeOfStudyEnrolment, nil) (defaults to: nil)

    the default scheme of study enrolment

  • programme_of_study (LUSI::API::Course::SchemeOfStudyEnrolment, nil) (defaults to: nil)

    synonym for scheme_of_study

  • entry_date (DateTime, nil) (defaults to: nil)

    the default start date of the scheme of study

  • expected_completion_date (DateTime, nil) (defaults to: nil)

    the default expected completion date

  • year_of_study (Integer, nil) (defaults to: nil)

    the default year of study

  • year_of_scheme_of_study (Integer, nil) (defaults to: nil)

    the default year of the scheme of study

  • modules (Array<LUSI::API::Course::ModuleEnrolment>, nil) (defaults to: nil)

    the default list of associated modules

  • relationships (Array<LUSI::API::Person::Relationship>, nil) (defaults to: nil)

    the default list of staff relationships

  • full_name_on_certificate (String, nil) (defaults to: nil)

    the default full certificate name

  • leave_details (LUSI::API::Person::LeaveDetails) (defaults to: nil)

    the default leaving details

  • user_account (Array<LUSI::API::Person::UserAccount>, nil) (defaults to: nil)

    the default list of user accounts



353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
# File 'lib/lusi_api/person/student.rb', line 353

def initialize(xml = nil, lookup = nil, identity: nil, external_institution_identity: nil, category: nil,
               college: nil, department: nil, attendance_status: nil, research_student: nil,
               programme_of_study: nil, scheme_of_study: nil, entry_date: nil, expected_completion_date: nil,
               year_of_study: nil, year_of_scheme_of_study: nil, modules: nil, relationships: nil,
               full_name_on_certificate: nil, leave_details: nil, user_account: nil)
  scheme_of_study ||= programme_of_study
  @identity = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Identity', identity)
  @external_institution_identity = LUSI::API::Core::XML.xml_content_at(xml,
                                                                        'xmlns:ExternalInstitutionIdentity',
                                                                        external_institution_identity)
  @category = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Category', category)
  @college = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:College', college)
  @department = LUSI::API::Core::XML.lookup(xml, lookup, :department, 'xmlns:Department', department)
  @attendance_status = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:AttendanceStatus', attendance_status)
  @research_student = LUSI::API::Core::XML.xml_boolean_at(xml, 'xmlns:ResearchStudent', research_student)
  @scheme_of_study = LUSI::API::Course::SchemeOfStudyEnrolment.new(
      LUSI::API::Core::XML.xml_at(xml, 'xmlns:ProgrammeOfStudy', scheme_of_study), lookup)
  @entry_date = LUSI::API::Core::XML.xml_datetime_at(xml, 'xmlns:EntryDate', )
  @expected_completion_date = LUSI::API::Core::XML.xml_datetime_at(xml, 'xmlns:ExpectedCompletionDate',
                                                                   expected_completion_date)
  @year_of_study = LUSI::API::Core::XML.xml_int_at(xml, 'xmlns:YearOfStudy', year_of_study)
  @year_of_scheme_of_study = LUSI::API::Core::XML.xml_int_at(xml, 'xmlns:YearOfSchemeOfStudy',
                                                             year_of_scheme_of_study)
  @modules = LUSI::API::Core::XML.xml(xml, 'xmlns:Modules/xmlns:Module') { |m| LUSI::API::Course::ModuleEnrolment.new(m, lookup) }
  @relationships = LUSI::API::Core::XML.xml(xml, 'xmlns:Relationships/xmlns:Relationship',
                                            relationships) { |r| Relationship.new(r, lookup) }
  @full_name_on_certificate = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:FullNameOnCertificate',
                                                                  full_name_on_certificate)
  @leave_details = LeaveDetails.new(LUSI::API::Core::XML.xml_at(xml, 'xmlns:LeaveDetails', leave_details),
                                    lookup)
  @user_account = LUSI::API::Core::XML.xml(xml, 'xmlns:UserAccounts/xmlns:UserAccount',
                                           ) { |a| UserAccount.new(a, lookup) }
end

Instance Attribute Details

#attendance_statusString?

Returns the current status of the registration.

Returns:

  • (String, nil)

    the current status of the registration



281
282
283
# File 'lib/lusi_api/person/student.rb', line 281

def attendance_status
  @attendance_status
end

#categoryString?

Returns the category (type) of registration.

Returns:

  • (String, nil)

    the category (type) of registration



268
269
270
# File 'lib/lusi_api/person/student.rb', line 268

def category
  @category
end

#collegeString?

Returns the associated college name.

Returns:

  • (String, nil)

    the associated college name



273
274
275
# File 'lib/lusi_api/person/student.rb', line 273

def college
  @college
end

#departmentLUSI::API::Organisation::Unit?

Returns the organisation Unit representing the associated department.

Returns:



277
278
279
# File 'lib/lusi_api/person/student.rb', line 277

def department
  @department
end

#entry_dateDateTime?

Returns the start date of the scheme of study.

Returns:

  • (DateTime, nil)

    the start date of the scheme of study



297
298
299
# File 'lib/lusi_api/person/student.rb', line 297

def 
  @entry_date
end

#expected_completion_dateDateTime?

Returns the expected date of completion.

Returns:

  • (DateTime, nil)

    the expected date of completion



301
302
303
# File 'lib/lusi_api/person/student.rb', line 301

def expected_completion_date
  @expected_completion_date
end

#external_institution_identityString?

Returns the external institutional identity code for the student registration.

Returns:

  • (String, nil)

    the external institutional identity code for the student registration



264
265
266
# File 'lib/lusi_api/person/student.rb', line 264

def external_institution_identity
  @external_institution_identity
end

#full_name_on_certificateString?

Returns the full name to be used on the certificate.

Returns:

  • (String, nil)

    the full name to be used on the certificate



321
322
323
# File 'lib/lusi_api/person/student.rb', line 321

def full_name_on_certificate
  @full_name_on_certificate
end

#identityString?

Returns the institutional identity code for the student registration.

Returns:

  • (String, nil)

    the institutional identity code for the student registration



260
261
262
# File 'lib/lusi_api/person/student.rb', line 260

def identity
  @identity
end

#leave_detailsLUSI::API::Person::LeaveDetails?

Returns the student’s leaving details, nil if still a current student.

Returns:



325
326
327
# File 'lib/lusi_api/person/student.rb', line 325

def leave_details
  @leave_details
end

#modulesArray<LUSI::API::Course::ModuleEnrolment>?

Returns an array of associated module enrolments.

Returns:



313
314
315
# File 'lib/lusi_api/person/student.rb', line 313

def modules
  @modules
end

#programme_of_study=(value) ⇒ Object

See Also:

  • LUSI::API::Person::StudentRecord.((#scheme_of_study)


293
294
295
# File 'lib/lusi_api/person/student.rb', line 293

def scheme_of_study
  @scheme_of_study
end

#relationshipsArray<LUSI::API::Person::Relationship>?

Returns an array of relationships for the student.

Returns:



317
318
319
# File 'lib/lusi_api/person/student.rb', line 317

def relationships
  @relationships
end

#research_studentBoolean?

Returns true if the registration is for a research course, otherwise false.

Returns:

  • (Boolean, nil)

    true if the registration is for a research course, otherwise false



285
286
287
# File 'lib/lusi_api/person/student.rb', line 285

def research_student
  @research_student
end

#scheme_of_studyLUSI::API::Course::SchemeOfStudy? Also known as: programme_of_study

Returns the student’s scheme (or programme) of study.

Returns:



289
290
291
# File 'lib/lusi_api/person/student.rb', line 289

def scheme_of_study
  @scheme_of_study
end

#user_accountArray<LUSI::API::Person::UserAccount>?

Returns an array of the student’s network accounts.

Returns:



329
330
331
# File 'lib/lusi_api/person/student.rb', line 329

def 
  @user_account
end

#year_of_scheme_of_studyInteger?

Returns the nominal year of the student’s scheme of study.

Returns:

  • (Integer, nil)

    the nominal year of the student’s scheme of study



309
310
311
# File 'lib/lusi_api/person/student.rb', line 309

def year_of_scheme_of_study
  @year_of_scheme_of_study
end

#year_of_studyInteger?

Returns the current year of study (1 = first year, 2 = second year etc.).

Returns:

  • (Integer, nil)

    the current year of study (1 = first year, 2 = second year etc.)



305
306
307
# File 'lib/lusi_api/person/student.rb', line 305

def year_of_study
  @year_of_study
end

Instance Method Details

#to_sString

Returns a string representation of the StudentRecord instance

Returns:

  • (String)

    the string representation of the instance



389
390
391
# File 'lib/lusi_api/person/student.rb', line 389

def to_s
  @identity
end