Class: LUSI::API::Course::ModuleEvaluationCohort

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

Overview

Represents a module evaluation cohort in the LUSI API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml = nil, lookup = nil, cohort_identity: nil, evaluation_date: nil, week_identity: nil) ⇒ void

Initialises a new ModuleEvaluationCohort instance

Parameters:

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

    the parsed XML root of the module evaluation cohort

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

    the lookup service for object resolution

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

    the default cohort identity code

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

    the default evaluation start date

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

    the default evaluation start week identity



834
835
836
837
838
# File 'lib/lusi_api/course.rb', line 834

def initialize(xml = nil, lookup = nil, cohort_identity: nil, evaluation_date: nil, week_identity: nil)
  @cohort_identity = LUSI::API::Core::XML.xml_int_at(xml, 'xmlns:CohortIdentity', cohort_identity)
  @evaluation_date = LUSI::API::Core::XML.xml_datetime_at(xml, 'xmlns:EvaluationDate', evaluation_date)
  @week_identity = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:WeekIdentity', week_identity)
end

Instance Attribute Details

#cohort identity(identity) ⇒ String?

Returns the identity code of the cohort.

Returns:

  • (String, nil)

    the identity code of the cohort



817
# File 'lib/lusi_api/course.rb', line 817

attr_accessor :cohort_identity

#cohort_identityObject

Returns the value of attribute cohort_identity.



817
818
819
# File 'lib/lusi_api/course.rb', line 817

def cohort_identity
  @cohort_identity
end

#evaluation_dateDateTime?

Returns the start date of module evaluation for the cohort.

Returns:

  • (DateTime, nil)

    the start date of module evaluation for the cohort



821
822
823
# File 'lib/lusi_api/course.rb', line 821

def evaluation_date
  @evaluation_date
end

#week_identityString?

Returns the starting week identity of module evaluation for the cohort.

Returns:

  • (String, nil)

    the starting week identity of module evaluation for the cohort



825
826
827
# File 'lib/lusi_api/course.rb', line 825

def week_identity
  @week_identity
end

Instance Method Details

#to_sString

Returns a string representation of the ModuleEvaluationCohort instance

Returns:

  • (String)

    the string representation of the ModuleEvaluationCohort instance



842
843
844
# File 'lib/lusi_api/course.rb', line 842

def to_s
  "#{@cohort_identity}: #{@evaluation_date}"
end