Class: Moodle2CC::Moodle2::Parsers::SectionParser

Inherits:
Object
  • Object
show all
Includes:
ParserHelper
Defined in:
lib/moodle2cc/moodle2/parsers/section_parser.rb

Constant Summary collapse

SECTION_XML =
'section.xml'

Constants included from ParserHelper

ParserHelper::FILES_XML, ParserHelper::IMS_FILEBASE_TOKEN, ParserHelper::MODULE_XML, ParserHelper::MOODLE_FILEBASE_TOKEN, ParserHelper::SLASH_TOKEN, ParserHelper::XML_NULL_VALUE

Instance Method Summary collapse

Methods included from ParserHelper

#activity_directories, #parse_boolean, #parse_module, #parse_text

Constructor Details

#initialize(backup_dir) ⇒ SectionParser

Returns a new instance of SectionParser.



7
8
9
# File 'lib/moodle2cc/moodle2/parsers/section_parser.rb', line 7

def initialize(backup_dir)
  @backup_dir = backup_dir
end

Instance Method Details

#parseObject



11
12
13
# File 'lib/moodle2cc/moodle2/parsers/section_parser.rb', line 11

def parse
  section_directories.each_with_index.map { |section, i| parse_section(section, i) }
end