Class: LUSI::API::VLE::VLESpace
- Inherits:
-
Object
- Object
- LUSI::API::VLE::VLESpace
- Defined in:
- lib/lusi_api/vle.rb
Instance Attribute Summary collapse
-
#copy_course_materials_from_prev_session ⇒ Boolean?
The space copy flag.
-
#course_departments ⇒ Array<LUSI::API::Course::CourseDepartment>?
The list of associated course departments.
-
#course_type ⇒ String?
The course type (CMOD|SOS).
-
#create_space_date ⇒ DateTime?
The VLE space creation date.
-
#create_space_date_utc ⇒ DateTime?
The UTC VLE space creation date.
-
#display_long_title ⇒ String?
The long course title.
-
#display_short_title ⇒ String?
The short course title.
-
#end_date ⇒ DateTime?
The VLE space end date.
-
#end_date_utc ⇒ DateTime?
The UTC VLE space end date.
-
#hide_content_on_rollover ⇒ Boolean?
The hide content on rollover flag.
-
#is_conversion_space ⇒ Boolean?
The space conversion flag.
-
#lusi_vle_space_id ⇒ String
The VLE space ID.
-
#lusi_year_id ⇒ String
The year identity code.
-
#space_type ⇒ String?
The space type (SINGLE|SHARED).
-
#start_date ⇒ DateTime?
The VLE space start date.
-
#start_date_utc ⇒ DateTime?
The UTC VLE space start date.
-
#student_access_date ⇒ DateTime?
The VLE space student access date.
-
#student_access_date_utc ⇒ DateTime?
The UTC VLE space student access date.
-
#url ⇒ String?
The VLE space URL.
-
#vle_provider ⇒ LUSI::API::Core::Code?
The VLE provider.
-
#vle_space_courses ⇒ Array<LUSI::API::VLESpace::VLESpaceCourse>?
The list of associated courses.
-
#vle_template ⇒ LUSI::API::Core::Code?
The VLE template.
Class Method Summary collapse
-
.get_instance(api, lookup = nil, **kwargs) {|obj| ... } ⇒ <Array<LUSI::API::VLE::VLESpace>] the matching instances
Returns an array of instances matching the specified search criteria.
-
.get_instance_params(**kwargs) {|obj| ... } ⇒ Array<VLESpace>?
Returns a hash of parameters for the LUSI API call.
Instance Method Summary collapse
-
#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) ⇒ void
constructor
Initialises a new VLESpace instance.
-
#to_s ⇒ String
Returns a string representation of the VLESpace instance.
Constructor Details
#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) ⇒ void
Initialises a new VLESpace instance
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# 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 |
Instance Attribute Details
#copy_course_materials_from_prev_session ⇒ Boolean?
Returns the space copy flag.
87 88 89 |
# File 'lib/lusi_api/vle.rb', line 87 def copy_course_materials_from_prev_session @copy_course_materials_from_prev_session end |
#course_departments ⇒ Array<LUSI::API::Course::CourseDepartment>?
Returns the list of associated course departments.
92 93 94 |
# File 'lib/lusi_api/vle.rb', line 92 def course_departments @course_departments end |
#course_type ⇒ String?
Returns the course type (CMOD|SOS).
96 97 98 |
# File 'lib/lusi_api/vle.rb', line 96 def course_type @course_type end |
#create_space_date ⇒ DateTime?
Returns the VLE space creation date.
100 101 102 |
# File 'lib/lusi_api/vle.rb', line 100 def create_space_date @create_space_date end |
#create_space_date_utc ⇒ DateTime?
Returns the UTC VLE space creation date.
104 105 106 |
# File 'lib/lusi_api/vle.rb', line 104 def create_space_date_utc @create_space_date_utc end |
#display_long_title ⇒ String?
Returns the long course title.
108 109 110 |
# File 'lib/lusi_api/vle.rb', line 108 def display_long_title @display_long_title end |
#display_short_title ⇒ String?
Returns the short course title.
112 113 114 |
# File 'lib/lusi_api/vle.rb', line 112 def display_short_title @display_short_title end |
#end_date ⇒ DateTime?
Returns the VLE space end date.
116 117 118 |
# File 'lib/lusi_api/vle.rb', line 116 def end_date @end_date end |
#end_date_utc ⇒ DateTime?
Returns the UTC VLE space end date.
120 121 122 |
# File 'lib/lusi_api/vle.rb', line 120 def end_date_utc @end_date_utc end |
#hide_content_on_rollover ⇒ Boolean?
Returns the hide content on rollover flag.
124 125 126 |
# File 'lib/lusi_api/vle.rb', line 124 def hide_content_on_rollover @hide_content_on_rollover end |
#is_conversion_space ⇒ Boolean?
Returns the space conversion flag.
128 129 130 |
# File 'lib/lusi_api/vle.rb', line 128 def is_conversion_space @is_conversion_space end |
#lusi_vle_space_id ⇒ String
Returns the VLE space ID.
136 137 138 |
# File 'lib/lusi_api/vle.rb', line 136 def lusi_vle_space_id @lusi_vle_space_id end |
#lusi_year_id ⇒ String
Returns the year identity code.
132 133 134 |
# File 'lib/lusi_api/vle.rb', line 132 def lusi_year_id @lusi_year_id end |
#space_type ⇒ String?
Returns the space type (SINGLE|SHARED).
140 141 142 |
# File 'lib/lusi_api/vle.rb', line 140 def space_type @space_type end |
#start_date ⇒ DateTime?
Returns the VLE space start date.
144 145 146 |
# File 'lib/lusi_api/vle.rb', line 144 def start_date @start_date end |
#start_date_utc ⇒ DateTime?
Returns the UTC VLE space start date.
148 149 150 |
# File 'lib/lusi_api/vle.rb', line 148 def start_date_utc @start_date_utc end |
#student_access_date ⇒ DateTime?
Returns the VLE space student access date.
152 153 154 |
# File 'lib/lusi_api/vle.rb', line 152 def student_access_date @student_access_date end |
#student_access_date_utc ⇒ DateTime?
Returns the UTC VLE space student access date.
156 157 158 |
# File 'lib/lusi_api/vle.rb', line 156 def student_access_date_utc @student_access_date_utc end |
#url ⇒ String?
Returns the VLE space URL.
160 161 162 |
# File 'lib/lusi_api/vle.rb', line 160 def url @url end |
#vle_provider ⇒ LUSI::API::Core::Code?
Returns the VLE provider.
164 165 166 |
# File 'lib/lusi_api/vle.rb', line 164 def vle_provider @vle_provider end |
#vle_space_courses ⇒ Array<LUSI::API::VLESpace::VLESpaceCourse>?
Returns the list of associated courses.
169 170 171 |
# File 'lib/lusi_api/vle.rb', line 169 def vle_space_courses @vle_space_courses end |
#vle_template ⇒ LUSI::API::Core::Code?
Returns the VLE template.
173 174 175 |
# File 'lib/lusi_api/vle.rb', line 173 def vle_template @vle_template end |
Class Method Details
.get_instance(api, lookup = nil, **kwargs) {|obj| ... } ⇒ <Array<LUSI::API::VLE::VLESpace>] the matching instances
Returns an array of instances matching the specified search criteria
181 182 183 184 185 186 187 188 189 190 |
# 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) {|obj| ... } ⇒ Array<VLESpace>?
Returns a hash of parameters for the LUSI API call.
216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# 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 |
Instance Method Details
#to_s ⇒ String
Returns a string representation of the VLESpace instance
316 317 318 |
# File 'lib/lusi_api/vle.rb', line 316 def to_s display_long_title || display_short_title end |