Class: Moodle2CC::CanvasCC::PageWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/moodle2cc/canvas_cc/page_writer.rb

Instance Method Summary collapse

Constructor Details

#initialize(work_dir, *pages) ⇒ PageWriter

Returns a new instance of PageWriter.



4
5
6
7
# File 'lib/moodle2cc/canvas_cc/page_writer.rb', line 4

def initialize(work_dir, *pages)
  @work_dir = work_dir
  @pages = pages
end

Instance Method Details

#writeObject



9
10
11
12
# File 'lib/moodle2cc/canvas_cc/page_writer.rb', line 9

def write
  Dir.mkdir(File.join(@work_dir, Moodle2CC::CanvasCC::Models::Page::WIKI_CONTENT))
  @pages.each { |page| write_html(page) }
end