Class: CanvasFactory::ModuleItemConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/japanda/canvas_factory/module_item_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ ModuleItemConfig

Returns a new instance of ModuleItemConfig.



5
6
7
8
9
10
# File 'lib/japanda/canvas_factory/module_item_config.rb', line 5

def initialize(opts = {})
  @module_item_type = opts[:module_item_type] || 'Assignment'
  @content_id = opts[:content_id]
  @completion_type = opts[:completion_type] || 'must_view'
  @title = opts[:title] || 'module_assignment'
end

Instance Attribute Details

#completion_typeObject

Returns the value of attribute completion_type.



3
4
5
# File 'lib/japanda/canvas_factory/module_item_config.rb', line 3

def completion_type
  @completion_type
end

#content_idObject

Returns the value of attribute content_id.



3
4
5
# File 'lib/japanda/canvas_factory/module_item_config.rb', line 3

def content_id
  @content_id
end

#module_item_typeObject

Returns the value of attribute module_item_type.



3
4
5
# File 'lib/japanda/canvas_factory/module_item_config.rb', line 3

def module_item_type
  @module_item_type
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/japanda/canvas_factory/module_item_config.rb', line 3

def title
  @title
end

Instance Method Details

#request_bodyObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/japanda/canvas_factory/module_item_config.rb', line 12

def request_body
  {
    module_item: {
      title: @title,
      type: @module_item_type,
      content_id: @content_id,
      completion_requirement: {
        type: @completion_type
      }
    }
  }
end