Class: LUSI::API::Course::SyllabusRuleType

Inherits:
LUSI::API::Core::Code show all
Defined in:
lib/lusi_api/course.rb

Overview

Represents a syllabus rule type in the LUSI API

Instance Attribute Summary collapse

Attributes inherited from LUSI::API::Core::BasicCode

#description, #identity

Instance Method Summary collapse

Methods inherited from LUSI::API::Core::Code

get_instance

Methods inherited from LUSI::API::Core::BasicCode

get_instance

Constructor Details

#initialize(xml = nil, lookup = nil, category: nil, **kwargs) ⇒ void

Initialises a new SyllabusRuleType instance

Parameters:

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

    the default rule type category (short description)



1064
1065
1066
1067
# File 'lib/lusi_api/course.rb', line 1064

def initialize(xml = nil, lookup = nil, category: nil, **kwargs)
  super(xml, **kwargs)
  @category = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Category', category)
end

Instance Attribute Details

#categoryString?

Returns the rule type category (short description).

Returns:

  • (String, nil)

    the rule type category (short description)



1058
1059
1060
# File 'lib/lusi_api/course.rb', line 1058

def category
  @category
end

Instance Method Details

#to_sString

Returns a string representation of the SyllabusRuleType instance

Returns:

  • (String)

    the string representation of the SyllabusRuleType instance



1071
1072
1073
# File 'lib/lusi_api/course.rb', line 1071

def to_s
  "[#{@category}]: #{@description}"
end