Class: Senkyoshi::Module
- Defined in:
- lib/senkyoshi/models/module.rb
Instance Attribute Summary collapse
-
#module_items ⇒ Object
Returns the value of attribute module_items.
Class Method Summary collapse
Instance Method Summary collapse
- #canvas_conversion ⇒ Object
-
#initialize(title, identifier) ⇒ Module
constructor
A new instance of Module.
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(title, identifier) ⇒ Module
22 23 24 25 26 |
# File 'lib/senkyoshi/models/module.rb', line 22 def initialize(title, identifier) @identifier = identifier @title = title @module_items = [] end |
Instance Attribute Details
#module_items ⇒ Object
Returns the value of attribute module_items.
20 21 22 |
# File 'lib/senkyoshi/models/module.rb', line 20 def module_items @module_items end |
Class Method Details
.find_module_from_item_id(modules, id) ⇒ Object
28 29 30 31 32 |
# File 'lib/senkyoshi/models/module.rb', line 28 def self.find_module_from_item_id(modules, id) modules.detect do |mod| mod.module_items.detect { |item| item.identifierref == id } end end |
Instance Method Details
#canvas_conversion ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/senkyoshi/models/module.rb', line 34 def canvas_conversion(*) CanvasCc::CanvasCC::Models::CanvasModule.new.tap do |cc_module| cc_module.identifier = @identifier cc_module.title = @title cc_module.workflow_state = "published" cc_module.module_items = @module_items end end |