Class: LUSI::API::Course::SchemeOfStudy

Inherits:
ModuleBase
  • Object
show all
Defined in:
lib/lusi_api/course.rb

Overview

Represents a scheme (or programme) of study in the LUSI API

Instance Attribute Summary collapse

Attributes inherited from ModuleBase

#category_level, #cohorts, #course_departments, #course_documents, #credit, #delivery_mode, #display_long_title, #display_short_title, #enrolled_students, #external_course_identity, #identity, #identity_class, #learning_hours, #mnemonic, #status, #syllabus_rules, #teaching_institution, #title, #year

Instance Method Summary collapse

Methods inherited from ModuleBase

#enrolment_lookup_keys, get_instance, #major_departments

Methods included from LUSI::API::Core::Endpoint

#lusi_ws_endpoint, #lusi_ws_method, #lusi_ws_path, #lusi_ws_xml_root

Constructor Details

#initialize(xml = nil, lookup = nil, awarding_institution: nil, credit_points: nil, director_of_studies: nil, length: nil, mode_of_study: nil, qualification: nil, ucas_course_code: nil, **kwargs) ⇒ void

Initialises a new SchemeOfStudy instance

Parameters:

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

    the default awarding institution

  • credit_points (LUSI::API::Course::CreditPoints, nil) (defaults to: nil)

    the default credit points

  • director_of_studies (Array<LUSI::API::Person::StaffMember>, nil) (defaults to: nil)

    the default director-of-studies list

  • length (LUSI::API::Course::Length) (defaults to: nil)

    the default scheme of study length

  • mode_of_study (LUSI::API::Core::Code) (defaults to: nil)

    the default mode of study

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

    the default qualification

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

    the default UCAS course code

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

    the parsed XML root of the module or scheme of study

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

    the lookup service for object resolution

  • category_level (String, nil)

    the default category

  • cohort (LUSI::API::Course::Cohort, nil)

    the default cohort

  • course_departments (Array<LUSI::API::Course::CourseDepartment>, nil)

    the default course departments

  • course_documents (Array<LUSI::API::Course::CourseDocument>, nil)

    the default course documents

  • credit (String, nil)

    the default credit point value

  • delivery_mode (LUSI::API::Core::Code, nil)

    the default delivery mode

  • display_long_title (String, nil)

    the default long title

  • display_short_title (String, nil)

    the default short title

  • enrolled_students (Integer, nil)

    the default number of enrolled students

  • external_course_identity (String, nil)

    the default external course identity code

  • identity (String, nil)

    the default identity code

  • learning_hours (Integer, nil)

    the default number of learning hours

  • mnemonic (String, nil)

    the default mnemonic

  • subjects (Array<LUSI::API::Course::Subject>, nil)

    the default subjects

  • status (String, nil)

    the default status

  • syllabus_rules (Array<SyllabusRule>, nil)

    the default syllabus rules

  • teaching_institution (LUSI::API::Organisation::Unit, nil)

    the default teaching institution

  • title (String, nil)

    the default title

  • year (String, nil)

    the default year



1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
# File 'lib/lusi_api/course.rb', line 1245

def initialize(xml = nil, lookup = nil, awarding_institution: nil, credit_points: nil, director_of_studies: nil,
               length: nil, mode_of_study: nil, qualification: nil, ucas_course_code: nil, **kwargs)
  super(xml, lookup, **kwargs)
  @awarding_institution = LUSI::API::Core::XML.lookup(xml, lookup, :organisation,
                                                      'xmlns:AwardingInstitution/xmlns:Identity',
                                                      awarding_institution)
  @credit_points = CreditPoints.new(LUSI::API::Core::XML.xml_at(xml, 'xmlns:CreditPoints', credit_points), lookup)
  @director_of_studies = LUSI::API::Core::XML.xml(xml, 'xmlns:DirectorOfStudies/xmlns:StaffMember',
                                                  director_of_studies) { |s| LUSI::API::Person::StaffMember.new(s, lookup) }
  @length = Length.new(LUSI::API::Core::XML.xml_at(xml, 'xmlns:Length', length), lookup)
  @mode_of_study = LUSI::API::Core::Code.new(LUSI::API::Core::XML::xml_at(xml, 'xmlns:ModeOfStudy',
                                                                          mode_of_study), lookup)
  @qualification = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Qualification', qualification)
  @ucas_course_code = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:UCASCourseCode', ucas_course_code)
end

Instance Attribute Details

#awarding_institutionLUSI::API::Organisation::Unit?

Returns the awarding institution for the scheme of study.

Returns:



1213
1214
1215
# File 'lib/lusi_api/course.rb', line 1213

def awarding_institution
  @awarding_institution
end

#credit_pointsLUSI::API::Course::CreditPoints?

Returns the required credit points for the scheme of study.

Returns:



1217
1218
1219
# File 'lib/lusi_api/course.rb', line 1217

def credit_points
  @credit_points
end

#lengthLUSI::API::Course::Length?

Returns the length of the scheme of study.

Returns:



1221
1222
1223
# File 'lib/lusi_api/course.rb', line 1221

def length
  @length
end

#mode_of_studyLUSI::API::Core::Code?

Returns the scheme’s mode of study.

Returns:



1225
1226
1227
# File 'lib/lusi_api/course.rb', line 1225

def mode_of_study
  @mode_of_study
end

#qualificationString?

Returns the qualification awarded by the scheme of study.

Returns:

  • (String, nil)

    the qualification awarded by the scheme of study



1229
1230
1231
# File 'lib/lusi_api/course.rb', line 1229

def qualification
  @qualification
end

#ucas_course_codeString?

Returns the UCAS course code for the scheme of study.

Returns:

  • (String, nil)

    the UCAS course code for the scheme of study



1233
1234
1235
# File 'lib/lusi_api/course.rb', line 1233

def ucas_course_code
  @ucas_course_code
end

Instance Method Details

#enrolment_lookup_indicesObject

See Also:

  • LUSI::API::Course::SchemeOfStudy.(LUSI(LUSI::API(LUSI::API::Course(LUSI::API::Course::ModuleBase(LUSI::API::Course::ModuleBase#enrolment_lookup_indices)


1262
1263
1264
# File 'lib/lusi_api/course.rb', line 1262

def enrolment_lookup_indices
  [:scheme_staff, :scheme_student]
end