class LUSI::API::Course::Subject
Attributes
department[RW]
@!attribute [rw] department
@return [LUSI::API::Organisation::Unit, nil] the department associated with the subject
group[RW]
@!attribute [rw] group
@return [String, nil] the group type of the subject
identity[RW]
@!attribute [rw] identity
@return [String, nil] the identity code of the subject
mnemonic[RW]
@!attribute [rw] mnemonic
@return [String, nil] the mnemonic for the subject
title[RW]
@!attribute [rw] title
@return [String, nil] the title of the subject
Public Class Methods
new(xml = nil, lookup = nil, department: nil, group: nil, identity: nil, mnemonic: nil, title: nil)
click to toggle source
Initialises a new Subject
instance @param xml [Nokogiri::XML::Document, Nokogiri::XML::Node] the parsed XML root of the subject @param lookup [LUSI::API::Core::LookupTable, nil] the lookup table for department resolution @param department [LUSI::API::Organisation::Unit, nil] the default department @param group [String, nil] the default group type @param identity [String, nil] the default identity code @param mnemonic [String, nil] the default mnemonic @param title [String, title] the default title @return [void]
# File lib/lusi_api/course.rb, line 998 def initialize(xml = nil, lookup = nil, department: nil, group: nil, identity: nil, mnemonic: nil, title: nil) @department = LUSI::API::Core::XML.lookup(xml, lookup, :department, 'xmlns:Department/xmlns:Identity', department) @group = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Group', group) @identity = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Identity', identity) @mnemonic = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Mnemonic', mnemonic) @title = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Title', title) end