Module: Moodle2CC::CC::Resource
- Included in:
- Assessment, Assignment, DiscussionTopic, Label, WebContent, WebLink, Wiki
- Defined in:
- lib/moodle2cc/cc/resource.rb
Class Method Summary collapse
Instance Method Summary collapse
- #create_files(export_dir) ⇒ Object
- #create_organization_item_node(item_node) ⇒ Object
- #create_resource_node(resources_node) ⇒ Object
- #initialize(mod, *args) ⇒ Object
Class Method Details
.included(klass) ⇒ Object
3 4 5 6 7 |
# File 'lib/moodle2cc/cc/resource.rb', line 3 def self.included(klass) klass.class_eval do attr_accessor :mod, :identifier, :id, :title, :indent end end |
Instance Method Details
#create_files(export_dir) ⇒ Object
17 18 |
# File 'lib/moodle2cc/cc/resource.rb', line 17 def create_files(export_dir) end |
#create_organization_item_node(item_node) ⇒ Object
23 24 25 26 27 |
# File 'lib/moodle2cc/cc/resource.rb', line 23 def create_organization_item_node(item_node) item_node.item(:identifier => create_mod_key(@mod), :identifierref => @identifier) do |sub_item| sub_item.title @title end end |
#create_resource_node(resources_node) ⇒ Object
20 21 |
# File 'lib/moodle2cc/cc/resource.rb', line 20 def create_resource_node(resources_node) end |
#initialize(mod, *args) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/moodle2cc/cc/resource.rb', line 9 def initialize(mod, *args) @mod = mod @id = mod.id @title = mod.name @indent = mod.section_mod.nil? ? 0 : mod.section_mod.indent @identifier = create_resource_key(mod) end |