class LUSI::API::VLE::VLESpace

Attributes

copy_course_materials_from_prev_session[RW]

@!attribute [rw] copy_course_materials_from_prev_session

@return [Boolean, nil] the space copy flag
course_departments[RW]

@!attribute [rw] course_departments

@return [Array<LUSI::API::Course::CourseDepartment>, nil] the list
  of associated course departments
course_type[RW]

@!attribute [rw] course_type

@return [String, nil] the course type (CMOD|SOS)
create_space_date[RW]

@!attribute [rw] create_space_date

@return [DateTime, nil] the VLE space creation date
create_space_date_utc[RW]

@!attribute [rw] create_space_date_utc

@return [DateTime, nil] the UTC VLE space creation date
display_long_title[RW]

@!attribute [rw] display_long_title

@return [String, nil] the long course title
display_short_title[RW]

@!attribute [rw] display_short_title

@return [String, nil] the short course title
end_date[RW]

@!attribute [rw] end_date

@return [DateTime, nil] the VLE space end date
end_date_utc[RW]

@!attribute [rw] end_date_utc

@return [DateTime, nil] the UTC VLE space end date
hide_content_on_rollover[RW]

@!attribute [rw] hide_content_on_rollover

@return [Boolean, nil] the hide content on rollover flag
is_conversion_space[RW]

@!attribute [rw] is_conversion_space

@return [Boolean, nil] the space conversion flag
lusi_vle_space_id[RW]

@!attribute [rw] lusi_vle_space_id

@return [String] the VLE space ID
lusi_year_id[RW]

@!attribute [rw] lusi_year_id

@return [String] the year identity code
space_type[RW]

@!attribute [rw] space_type

@return [String, nil] the space type (SINGLE|SHARED)
start_date[RW]

@!attribute [rw] start_date

@return [DateTime, nil] the VLE space start date
start_date_utc[RW]

@!attribute [rw] start_date_utc

@return [DateTime, nil] the UTC VLE space start date
student_access_date[RW]

@!attribute [rw] student_access_date

@return [DateTime, nil] the VLE space student access date
student_access_date_utc[RW]

@!attribute [rw] student_access_date_utc

@return [DateTime, nil] the UTC VLE space student access date
url[RW]

@!attribute [rw] url

@return [String, nil] the VLE space URL
vle_provider[RW]

@!attribute [rw] vle_provider

@return [LUSI::API::Core::Code, nil] the VLE provider
vle_space_courses[RW]

@!attribute [rw] vle_space_courses

@return [Array<LUSI::API::VLESpace::VLESpaceCourse>, nil] the list
  of associated courses
vle_template[RW]

@!attribute [rw] vle_template

@return [LUSI::API::Core::Code, nil] the VLE template

Public Class Methods

get_instance(api, lookup = nil, **kwargs) { |obj| ... } click to toggle source

Returns an array of instances matching the specified search criteria @param api [LUSI::API::Core::API] the LUSI API instance for searching @param (see get_instance_params) @return [<Array<LUSI::API::VLE::VLESpace>] the matching instances @yield [obj] Passes the instance to the block @yieldparam obj [LUSI::API::VLE::VLESpace] the instance

# File lib/lusi_api/vle.rb, line 181
def self.get_instance(api, lookup = nil, **kwargs)
  params = get_instance_params(**kwargs)
  xml = api.call('LUSIReference', 'General.asmx', 'GetVLESpaces',
                 **params)
  LUSI::API::Core::XML.xml(xml, 'xmlns:VLESpace') do |m|
    obj = self.new(m, lookup)
    yield(obj) if block_given?
    obj
  end
end
get_instance_params(**kwargs) click to toggle source

Returns a hash of parameters for the LUSI API call. @param asp_identity [String, nil] return instances matching this

academic significant period (ASP)

@param cohort_identity (String, nil) return instances matching this

cohort identity

@param course_identity [String, nil] return instances matching this

course identity

@param course_type [String, nil] return instances matching this course

type (CMOD|SOS)

@param department_identity (String, nil) return instances matching

this department identity

@param space_type [String, nil] return instances matching this space

type (SHARED|SINGLE)

@param vle_space_identity [String, nil] return instances matching this

VLE space identity

@param vle_provider_identity [String, nil] return instances matching

this VLE provider identity

@param year_identity (String, nil) return instances matching this year

identity

@param active_vle_space_only [Boolean, nil] if true, return only

active VLE spaces, otherwise return all spaces

@return [Array<VLESpace>, nil] the matching VLESpace instances @yield [obj] Passes the VLESpace instance to the block @yieldparam obj [LUSI::API::VLE::VLESpace] the VLESpace instance

# File lib/lusi_api/vle.rb, line 216
def self.get_instance_params(**kwargs)
  {
    ActiveVLESpaceOnly: kwargs.fetch(:active_vle_space_only, true) ? 'true' : 'false',
    ASPIdentity: kwargs.fetch(:asp_identity, ''),
    CohortIdentity: kwargs.fetch(:cohort_identity, ''),
    CourseIdentity: kwargs.fetch(:course_identity, ''),
    CourseType: kwargs.fetch(:course_type, ''),
    DepartmentIdentity: kwargs.fetch(:department_identity, ''),
    SpaceType: kwargs.fetch(:space_type, ''),
    VLEProviderIdentity: kwargs.fetch(:vle_provider_identity, ''),
    VLESpaceIdentity: kwargs.fetch(:vle_space_identity, ''),
    YearIdentity: kwargs.fetch(:year_identity, '')
  }
end
new(xml = nil, lookup = nil, copy_course_materials_from_prev_session: nil, course_departments: nil, course_type: nil, create_space_date: nil, create_space_date_utc: nil, display_long_title: nil, display_short_title: nil, end_date: nil, end_date_utc: nil, hide_content_on_rollover: nil, is_conversion_space: nil, lusi_vle_space_id: nil, lusi_year_id: nil, space_type: nil, start_date: nil, start_date_utc: nil, student_access_date: nil, student_access_date_utc: nil, url: nil, vle_provider: nil, vle_space_courses: nil, vle_template: nil) click to toggle source

Initialises a new VLESpace instance @param xml [Nokogiri::XML::Document, Nokogiri::XML::Node] the parsed XML root of the VLE space @param lookup [LUSI::API::Core::Lookup::LookupService, nil] the lookup service for object resolution @param copy_course_materials_from_prev_session [Boolean, nil] the

default space copy flag

@param course_departments [Array<LUSI::API::Course::CourseDepartment>, nil] the default course departments @param course_type [String, nil] the default course type @param create_space_date [DateTime] the default VLE space creation date @param create_space_date_utc [DateTime] the default UTC VLE space creation date @param display_long_title [String, nil] the default long title @param display_short_title [String, nil] the default short title @param end_date [DateTime] the default VLE space end date @param end_date_utc [DateTime] the default UTC VLE space end date @param hide_content_on_rollover [Boolean, nil] the default hide

content on rollover flag

@param is_conversion_space [Boolean, nil] the default conversion space

flag

@param lusi_vle_space_id [String, nil] the default VLE space ID @param lusi_year_id [String, nil] the default year identity code @param space_type [String, nil] the default space type @param start_date [DateTime] the default VLE space start date @param start_date_utc [DateTime] the default UTC VLE space start date @param student_access_date [DateTime] the default student enrolment date @param student_access_date_utc [DateTime] the default UTC student enrolment date @param url [String, nil] the URL for the VLE space @param vle_provider [LUSI::API::Core::Code] the VLE provider @param vle_space_courses [Array<LUSI::API::VLESpace::VLESpaceCourse>]

the list of associated courses

@param vle_template [LUSI::API::Core::Code] the VLE template @return [void]

# File lib/lusi_api/vle.rb, line 261
def initialize(xml = nil, lookup = nil,
               copy_course_materials_from_prev_session: nil,
               course_departments: nil,
               course_type: nil,
               create_space_date: nil,
               create_space_date_utc: nil,
               display_long_title: nil,
               display_short_title: nil,
               end_date: nil,
               end_date_utc: nil,
               hide_content_on_rollover: nil,
               is_conversion_space: nil,
               lusi_vle_space_id: nil,
               lusi_year_id: nil,
               space_type: nil,
               start_date: nil,
               start_date_utc: nil,
               student_access_date: nil,
               student_access_date_utc: nil,
               url: nil,
               vle_provider: nil,
               vle_space_courses: nil,
               vle_template: nil)
  @copy_course_materials_from_prev_session = LUSI::API::Core::XML.xml_boolean_at(xml, 'xmlns:CopyCourseMaterialsFromPrevSession', copy_course_materials_from_prev_session)
  @course_departments = LUSI::API::Core::XML.xml(xml, 'xmlns:Departments/xmlns:CourseDepartment',
                                                 course_departments) { |d| LUSI::API::Course::CourseDepartment.new(d, lookup) }
  @course_type = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:CourseType', course_type)
  @create_space_date = LUSI::API::Core::XML.xml_datetime_at(xml, 'xmlns:CreateSpaceDate', create_space_date)
  @create_space_date_utc = LUSI::API::Core::XML.xml_datetime_at(xml, 'xmlns:CreateSpaceDateUTC', create_space_date_utc)
  @display_long_title = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:DisplayLongTitle', display_long_title)
  @display_short_title = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:DisplayShortTitle',
                                                             display_short_title)
  @end_date = LUSI::API::Core::XML.xml_datetime_at(xml, 'xmlns:EndDate', end_date)
  @end_date_utc = LUSI::API::Core::XML.xml_datetime_at(xml, 'xmlns:EndDateUTC', end_date_utc)
  @hide_content_on_rollover = LUSI::API::Core::XML.xml_boolean_at(xml, 'xmlns:HideContentOnRollover', hide_content_on_rollover)
  @is_conversion_space = LUSI::API::Core::XML.xml_boolean_at(xml, 'xmlns:IsConversionSpace', is_conversion_space)
  @lusi_vle_space_id = LUSI::API::Core::XML.xml_content_at(xml, '@LUSIVLESpaceId', lusi_vle_space_id)
  @lusi_year_id = LUSI::API::Core::XML.xml_content_at(xml, '@LUSIYearId', lusi_year_id)
  @space_type = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:SpaceType', space_type)
  @start_date = LUSI::API::Core::XML.xml_datetime_at(xml, 'xmlns:StartDate', start_date)
  @start_date_utc = LUSI::API::Core::XML.xml_datetime_at(xml, 'xmlns:StartDateUTC', start_date_utc)
  @student_access_date = LUSI::API::Core::XML.xml_datetime_at(xml, 'xmlns:StudentAccessDate', student_access_date)
  @student_access_date_utc = LUSI::API::Core::XML.xml_datetime_at(xml, 'xmlns:StudentAccessDateUTC', student_access_date_utc)
  @url = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:URL', url)

  @vle_provider = LUSI::API::Core::Code.new(LUSI::API::Core::XML.xml_at(xml, 'xmlns:VLEProvider',
                                                                        vle_provider), lookup)
  @vle_space_courses = LUSI::API::Core::XML.xml(xml, 'xmlns:VLESpaceCourses/xmlns:VLESpaceCourse',
                                                vle_space_courses) { |c| VLESpaceCourse.new(c, lookup) }
  @vle_template = LUSI::API::Core::Code.new(LUSI::API::Core::XML.xml_at(xml, 'xmlns:VLETemplate',
                                                                        vle_template), lookup)
end

Public Instance Methods

to_s() click to toggle source

Returns a string representation of the VLESpace instance @return [String] the string representation of the VLESpace instance

# File lib/lusi_api/vle.rb, line 316
def to_s
  display_long_title || display_short_title
end