Class: CanvasFactory::ModuleItemConfig
- Inherits:
-
Object
- Object
- CanvasFactory::ModuleItemConfig
- Defined in:
- lib/japanda/canvas_factory/module_item_config.rb
Instance Attribute Summary collapse
-
#completion_type ⇒ Object
Returns the value of attribute completion_type.
-
#content_id ⇒ Object
Returns the value of attribute content_id.
-
#module_item_type ⇒ Object
Returns the value of attribute module_item_type.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ ModuleItemConfig
constructor
A new instance of ModuleItemConfig.
- #request_body ⇒ Object
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_type ⇒ Object
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_id ⇒ Object
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_type ⇒ Object
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 |
#title ⇒ Object
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_body ⇒ Object
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 |