Class: LUSI::API::Person::StudentRecord
- Inherits:
-
Object
- Object
- LUSI::API::Person::StudentRecord
- Defined in:
- lib/lusi_api/person/student.rb
Overview
Represents a student record in the LUSI API
Instance Attribute Summary collapse
-
#attendance_status ⇒ String?
The current status of the registration.
-
#category ⇒ String?
The category (type) of registration.
-
#college ⇒ String?
The associated college name.
-
#department ⇒ LUSI::API::Organisation::Unit?
The organisation Unit representing the associated department.
-
#entry_date ⇒ DateTime?
The start date of the scheme of study.
-
#expected_completion_date ⇒ DateTime?
The expected date of completion.
-
#external_institution_identity ⇒ String?
The external institutional identity code for the student registration.
-
#full_name_on_certificate ⇒ String?
The full name to be used on the certificate.
-
#identity ⇒ String?
The institutional identity code for the student registration.
-
#leave_details ⇒ LUSI::API::Person::LeaveDetails?
The student’s leaving details, nil if still a current student.
-
#modules ⇒ Array<LUSI::API::Course::ModuleEnrolment>?
An array of associated module enrolments.
- #programme_of_study ⇒ Object
-
#relationships ⇒ Array<LUSI::API::Person::Relationship>?
An array of relationships for the student.
-
#research_student ⇒ Boolean?
True if the registration is for a research course, otherwise false.
-
#scheme_of_study ⇒ LUSI::API::Course::SchemeOfStudy?
(also: #programme_of_study)
The student’s scheme (or programme) of study.
-
#user_account ⇒ Array<LUSI::API::Person::UserAccount>?
An array of the student’s network accounts.
-
#year_of_scheme_of_study ⇒ Integer?
The nominal year of the student’s scheme of study.
-
#year_of_study ⇒ Integer?
The current year of study (1 = first year, 2 = second year etc.).
Instance Method Summary collapse
-
#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
constructor
Initialises a new StudentRecord instance.
-
#to_s ⇒ String
Returns a string representation of the StudentRecord instance.
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
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', entry_date) @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', user_account) { |a| UserAccount.new(a, lookup) } end |
Instance Attribute Details
#attendance_status ⇒ String?
Returns the current status of the registration.
281 282 283 |
# File 'lib/lusi_api/person/student.rb', line 281 def attendance_status @attendance_status end |
#category ⇒ String?
Returns the category (type) of registration.
268 269 270 |
# File 'lib/lusi_api/person/student.rb', line 268 def category @category end |
#college ⇒ String?
Returns the associated college name.
273 274 275 |
# File 'lib/lusi_api/person/student.rb', line 273 def college @college end |
#department ⇒ LUSI::API::Organisation::Unit?
Returns the organisation Unit representing the associated department.
277 278 279 |
# File 'lib/lusi_api/person/student.rb', line 277 def department @department end |
#entry_date ⇒ DateTime?
Returns the start date of the scheme of study.
297 298 299 |
# File 'lib/lusi_api/person/student.rb', line 297 def entry_date @entry_date end |
#expected_completion_date ⇒ DateTime?
Returns 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_identity ⇒ String?
Returns 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_certificate ⇒ String?
Returns 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 |
#identity ⇒ String?
Returns 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_details ⇒ LUSI::API::Person::LeaveDetails?
Returns the student’s leaving details, nil if still a current student.
325 326 327 |
# File 'lib/lusi_api/person/student.rb', line 325 def leave_details @leave_details end |
#modules ⇒ Array<LUSI::API::Course::ModuleEnrolment>?
Returns an array of associated module enrolments.
313 314 315 |
# File 'lib/lusi_api/person/student.rb', line 313 def modules @modules end |
#programme_of_study=(value) ⇒ Object
293 294 295 |
# File 'lib/lusi_api/person/student.rb', line 293 def scheme_of_study @scheme_of_study end |
#relationships ⇒ Array<LUSI::API::Person::Relationship>?
Returns an array of relationships for the student.
317 318 319 |
# File 'lib/lusi_api/person/student.rb', line 317 def relationships @relationships end |
#research_student ⇒ Boolean?
Returns 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_study ⇒ LUSI::API::Course::SchemeOfStudy? Also known as: programme_of_study
Returns the student’s scheme (or programme) of study.
289 290 291 |
# File 'lib/lusi_api/person/student.rb', line 289 def scheme_of_study @scheme_of_study end |
#user_account ⇒ Array<LUSI::API::Person::UserAccount>?
Returns an array of the student’s network accounts.
329 330 331 |
# File 'lib/lusi_api/person/student.rb', line 329 def user_account @user_account end |
#year_of_scheme_of_study ⇒ Integer?
Returns 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_study ⇒ Integer?
Returns 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_s ⇒ String
Returns a string representation of the StudentRecord instance
389 390 391 |
# File 'lib/lusi_api/person/student.rb', line 389 def to_s @identity end |