Class: LUSI::API::Course::CourseDepartment

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

Overview

Represents a department participating in a course

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml = nil, lookup = nil, identity: nil, is_major_department: nil, org_unit: nil, title: nil) ⇒ void

Initialises a new CourseDepartment instance

Parameters:

  • identity (String) (defaults to: nil)

    the course department’s identity code

  • org_unit (LUSI::API::Organisation::Unit) (defaults to: nil)

    the default organisation unit for the department

  • is_major_department (Boolean, nil) (defaults to: nil)

    the major (administering) department flag

  • title (String) (defaults to: nil)

    the course department’s title



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

#identityString

Returns the course department identity code.

Returns:

  • (String)

    the course department identity code



516
517
518
# File 'lib/lusi_api/course.rb', line 516

def identity
  @identity
end

#is_major_departmentBoolean

Returns true if the department is the major (administering) department, otherwise false.

Returns:

  • (Boolean)

    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_unitLUSI::API::Organisation::Unit

Returns the organisation unit representing the department.

Returns:



512
513
514
# File 'lib/lusi_api/course.rb', line 512

def org_unit
  @org_unit
end

#titleString

Returns the course department’s title.

Returns:

  • (String)

    the course department’s title



524
525
526
# File 'lib/lusi_api/course.rb', line 524

def title
  @title
end