Class: LUSI::API::Course::SyllabusRuleModule

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

Overview

Represents a syllabus rule in the LUSI API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml = nil, lookup = nil, display_long_title: nil, display_short_title: nil, identity: nil) ⇒ void

Initialises a new SyllabusRuleModule instance

Parameters:

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

    the parsed XML root of the syllabus rule module

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

    the lookup service for object resolution

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

    the default identity code

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

    the default long title

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

    the default short title



1038
1039
1040
1041
1042
# File 'lib/lusi_api/course.rb', line 1038

def initialize(xml = nil, lookup = nil, display_long_title: nil, display_short_title: nil, identity: nil)
  @display_long_title = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:DisplayLongTitle', display_long_title)
  @display_short_title = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:DisplayShortTitle', display_short_title)
  @identity = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Identity', identity)
end

Instance Attribute Details

#display_long_titleString?

Returns the long title of the rule.

Returns:

  • (String, nil)

    the long title of the rule



1025
1026
1027
# File 'lib/lusi_api/course.rb', line 1025

def display_long_title
  @display_long_title
end

#display_short_titleString?

Returns the short title of the rule.

Returns:

  • (String, nil)

    the short title of the rule



1029
1030
1031
# File 'lib/lusi_api/course.rb', line 1029

def display_short_title
  @display_short_title
end

#identityLUSI::API::Course::Identity?

Returns the identity code of the associatied module or scheme of study.

Returns:



1021
1022
1023
# File 'lib/lusi_api/course.rb', line 1021

def identity
  @identity
end

Instance Method Details

#to_sString

Returns a string representation to the SyllabusRuleModule instance

Returns:

  • (String)

    the string representation to the SyllabusRuleModule instance



1046
1047
1048
# File 'lib/lusi_api/course.rb', line 1046

def to_s
  @display_long_title
end