class LUSI::API::Course::SchemeOfStudy

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

Attributes

awarding_institution[RW]

@!attribute [rw] awarding_institution

@return [LUSI::API::Organisation::Unit, nil] the awarding institution for the scheme of study
credit_points[RW]

@!attribute [rw] credit_points

@return [LUSI::API::Course::CreditPoints, nil] the required credit points for the scheme of study
length[RW]

@!attribute [rw] length

@return [LUSI::API::Course::Length, nil] the length of the scheme of study
mode_of_study[RW]

@!attribute [rw] mode_of_study

@return [LUSI::API::Core::Code, nil] the scheme's mode of study
qualification[RW]

@!attribute [rw] qualification

@return [String, nil] the qualification awarded by the scheme of study
ucas_course_code[RW]

@!attribute [rw] ucas_course_code

@return [String, nil] the UCAS course code for the scheme of study

Public Class Methods

new(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) click to toggle source

Initialises a new SchemeOfStudy instance @param (see LUSI::API::Course::ModuleBase#initialize) @param awarding_institution [LUSI::API::Organisation::Unit, nil] the default awarding institution @param credit_points [LUSI::API::Course::CreditPoints, nil] the default credit points @param director_of_studies [Array<LUSI::API::Person::StaffMember>, nil] the default director-of-studies list @param length [LUSI::API::Course::Length] the default scheme of study length @param mode_of_study [LUSI::API::Core::Code] the default mode of study @param qualification [String, nil] the default qualification @param ucas_course_code [String, nil] the default UCAS course code @return [void]

Calls superclass method LUSI::API::Course::ModuleBase::new
# 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

Protected Class Methods

get_instance_params(awarding_institution_id: nil, **kwargs) click to toggle source

Returns a hash of parameters for the LUSI API call @param (see LUSI::API::Course::ModuleBase#get_instance_params) @param awarding_institution_id [String, nil] the awarding institution identity code

# File lib/lusi_api/course.rb, line 1271
def self.get_instance_params(awarding_institution_id: nil, **kwargs)
  params = super(**kwargs)
  params[:AwardingInstitutionId] = kwargs.fetch(:awarding_institution_id, '')
  params
end
lusi_ws_endpoint() click to toggle source

Returns the LUSI API endpoint @return [String] the LUSI API endpoint

# File lib/lusi_api/course.rb, line 1279
def self.lusi_ws_endpoint
  'General.asmx'
end
lusi_ws_method() click to toggle source

Returns the LUSI API method @return [String] the LUSI API method

# File lib/lusi_api/course.rb, line 1285
def self.lusi_ws_method
  'GetSchemesOfStudy'
end
lusi_ws_xml_root() click to toggle source

Returns the root element name of the LUSI API XML response @return [String] the root element name of the LUSI API XML response

# File lib/lusi_api/course.rb, line 1291
def self.lusi_ws_xml_root
  'SchemeOfStudy'
end

Public Instance Methods

enrolment_lookup_indices() click to toggle source

@see (LUSI::API::Course::ModuleBase#enrolment_lookup_indices)

# File lib/lusi_api/course.rb, line 1262
def enrolment_lookup_indices
  [:scheme_staff, :scheme_student]
end