Class: Senkyoshi::Course

Inherits:
Resource show all
Defined in:
lib/senkyoshi/models/course.rb

Instance Method Summary collapse

Methods inherited from Resource

#_search_and_replace, #cleanup, #fix_html, #matches_xid?

Constructor Details

#initializeCourse

This class represents a reader for one zip file, and allows the usage of individual files within zip file



9
10
11
12
13
14
15
16
17
# File 'lib/senkyoshi/models/course.rb', line 9

def initialize
  @course_code = ""
  @identifier = ""
  @title = ""
  @description = ""
  @is_public = false
  @start_at = ""
  @conclude_at = ""
end

Instance Method Details

#canvas_conversion(course, _resources = nil) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/senkyoshi/models/course.rb', line 29

def canvas_conversion(course, _resources = nil)
  course.identifier = @identifier
  course.title = @title
  course.description = @description
  course.is_public = @is_public
  course.start_at = @start_at
  course.conclude_at = @conclude_at
  course
end

#iterate_xml(data, _) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/senkyoshi/models/course.rb', line 19

def iterate_xml(data, _)
  @identifier = data["id"]
  @title = Senkyoshi.get_attribute_value(data, "TITLE")
  @description = Senkyoshi.get_description(data)
  @is_public = Senkyoshi.get_attribute_value(data, "ISAVAILABLE")
  @start_at = Senkyoshi.get_attribute_value(data, "COURSESTART")
  @conclude_at = Senkyoshi.get_attribute_value(data, "COURSEEND")
  self
end