Class: LUSI::API::Course::Subject
- Inherits:
-
Object
- Object
- LUSI::API::Course::Subject
- Defined in:
- lib/lusi_api/course.rb
Overview
Represents a subject in the LUSI API
Instance Attribute Summary collapse
-
#department ⇒ LUSI::API::Organisation::Unit?
The department associated with the subject.
-
#group ⇒ String?
The group type of the subject.
-
#identity ⇒ String?
The identity code of the subject.
-
#mnemonic ⇒ String?
The mnemonic for the subject.
-
#title ⇒ String?
The title of the subject.
Instance Method Summary collapse
-
#initialize(xml = nil, lookup = nil, department: nil, group: nil, identity: nil, mnemonic: nil, title: nil) ⇒ void
constructor
Initialises a new Subject instance.
-
#to_s ⇒ String
Returns a string representation of the Subject instance.
Constructor Details
#initialize(xml = nil, lookup = nil, department: nil, group: nil, identity: nil, mnemonic: nil, title: nil) ⇒ void
Initialises a new Subject instance
998 999 1000 1001 1002 1003 1004 1005 |
# 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 |
Instance Attribute Details
#department ⇒ LUSI::API::Organisation::Unit?
Returns the department associated with the subject.
987 988 989 |
# File 'lib/lusi_api/course.rb', line 987 def department @department end |
#group ⇒ String?
Returns the group type of the subject.
983 984 985 |
# File 'lib/lusi_api/course.rb', line 983 def group @group end |
#identity ⇒ String?
Returns the identity code of the subject.
971 972 973 |
# File 'lib/lusi_api/course.rb', line 971 def identity @identity end |
#mnemonic ⇒ String?
Returns the mnemonic for the subject.
975 976 977 |
# File 'lib/lusi_api/course.rb', line 975 def mnemonic @mnemonic end |
#title ⇒ String?
Returns the title of the subject.
979 980 981 |
# File 'lib/lusi_api/course.rb', line 979 def title @title end |
Instance Method Details
#to_s ⇒ String
Returns a string representation of the Subject instance
1009 1010 1011 |
# File 'lib/lusi_api/course.rb', line 1009 def to_s @title end |