Class: LUSI::API::Course::CourseDepartment
- Inherits:
-
Object
- Object
- LUSI::API::Course::CourseDepartment
- Defined in:
- lib/lusi_api/course.rb
Overview
Represents a department participating in a course
Instance Attribute Summary collapse
-
#identity ⇒ String
The course department identity code.
-
#is_major_department ⇒ Boolean
True if the department is the major (administering) department, otherwise false.
-
#org_unit ⇒ LUSI::API::Organisation::Unit
The organisation unit representing the department.
-
#title ⇒ String
The course department’s title.
Instance Method Summary collapse
-
#initialize(xml = nil, lookup = nil, identity: nil, is_major_department: nil, org_unit: nil, title: nil) ⇒ void
constructor
Initialises a new CourseDepartment instance.
Constructor Details
#initialize(xml = nil, lookup = nil, identity: nil, is_major_department: nil, org_unit: nil, title: nil) ⇒ void
Initialises a new CourseDepartment instance
532 533 534 535 536 537 538 |
# File 'lib/lusi_api/course.rb', line 532 def initialize(xml = nil, lookup = nil, identity: nil, is_major_department: nil, org_unit: nil, title: nil) is_major_department = is_major_department ? true : false @identity = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Identity', identity) @is_major_department = LUSI::API::Core::XML.xml_boolean_at(xml, 'xmlns:IsMajorDepartment', is_major_department) @org_unit = LUSI::API::Core::XML.lookup(xml, lookup, :department, 'xmlns:Identity', org_unit) @title = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Title', title) end |
Instance Attribute Details
#identity ⇒ String
Returns the course department identity code.
516 517 518 |
# File 'lib/lusi_api/course.rb', line 516 def identity @identity end |
#is_major_department ⇒ Boolean
Returns true if the department is the major (administering) department, otherwise false.
520 521 522 |
# File 'lib/lusi_api/course.rb', line 520 def is_major_department @is_major_department end |
#org_unit ⇒ LUSI::API::Organisation::Unit
Returns the organisation unit representing the department.
512 513 514 |
# File 'lib/lusi_api/course.rb', line 512 def org_unit @org_unit end |
#title ⇒ String
Returns the course department’s title.
524 525 526 |
# File 'lib/lusi_api/course.rb', line 524 def title @title end |