Class: Senkyoshi::Forum

Inherits:
FileResource show all
Defined in:
lib/senkyoshi/models/forum.rb

Instance Attribute Summary

Attributes inherited from FileResource

#id

Instance Method Summary collapse

Methods inherited from FileResource

from

Methods inherited from Resource

#_find_directories, #_fix_path, #_matches_directory_xid?, #_search_and_replace, #cleanup, #fix_html, get_pre_data, #matches_xid?, #strip_xid

Constructor Details

#initialize(resource_id) ⇒ Forum

Returns a new instance of Forum.



5
6
7
8
9
10
# File 'lib/senkyoshi/models/forum.rb', line 5

def initialize(resource_id)
  super(resource_id)
  @title = ""
  @text = ""
  @discussion_type = "threaded"
end

Instance Method Details

#canvas_conversion(course, _resources = nil) ⇒ Object



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

def canvas_conversion(course, _resources = nil)
  discussion = CanvasCc::CanvasCC::Models::Discussion.new
  discussion.title = @title
  discussion.text = @text
  discussion.identifier = @id
  discussion.discussion_type = @discussion_type
  course.discussions << discussion
  course
end

#iterate_xml(data, _) ⇒ Object



12
13
14
15
16
# File 'lib/senkyoshi/models/forum.rb', line 12

def iterate_xml(data, _)
  @title = Senkyoshi.get_attribute_value(data, "TITLE")
  @text = Senkyoshi.get_text(data, "TEXT")
  self
end