Class: LUSI::API::Course::CourseEnrolment Abstract

Inherits:
Enrolment::EnrolmentBase show all
Defined in:
lib/lusi_api/course.rb

Overview

This class is abstract.

Subclasses must implement lookup_index and alias :course_identity to the accessor for the subclass-specific identity.

The abstract base class for module/scheme of study enrolments

Direct Known Subclasses

ModuleEnrolment, SchemeOfStudyEnrolment

Instance Attribute Summary

Attributes inherited from Enrolment::EnrolmentBase

#enrolment_role, #identity, #is_current_enrolment, #is_current_identity, #username

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Enrolment::EnrolmentBase

get_instance, #initialize, lusi_ws_path

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

#lusi_ws_endpoint, #lusi_ws_method, #lusi_ws_path, #lusi_ws_xml_root

Constructor Details

This class inherits a constructor from LUSI::API::Enrolment::EnrolmentBase

Class Method Details

.lookup_indexSymbol

Returns the index name used for the module/scheme of study identity

Returns:

  • (Symbol)

    the module/scheme of study index name

Raises:

  • (NotImplementedError)


761
762
763
# File 'lib/lusi_api/course.rb', line 761

def self.lookup_index
  raise NotImplementedError
end

Instance Method Details

#lookup_indicesObject

See Also:

  • LUSI::API::Course::CourseEnrolment.(LUSI(LUSI::API(LUSI::API::Enrolment(LUSI::API::Enrolment::EnrolmentBase(LUSI::API::Enrolment::EnrolmentBase#lookup_indices)


766
767
768
# File 'lib/lusi_api/course.rb', line 766

def lookup_indices
  super.push(self.lookup_index)
end

#lookup_key(index) ⇒ Object

See Also:

  • LUSI::API::Course::CourseEnrolment.(LUSI(LUSI::API(LUSI::API::Enrolment(LUSI::API::Enrolment::EnrolmentBase(LUSI::API::Enrolment::EnrolmentBase#lookup_key)


771
772
773
774
775
776
777
778
# File 'lib/lusi_api/course.rb', line 771

def lookup_key(index)
  # self.course_identity should be defined by all subclasses
  if index == self.lookup_index
    self.course_identity.lookup_key
  else
    super(index)
  end
end