Class: PageExporter

Inherits:
Object
  • Object
show all
Defined in:
app/models/page_exporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_dir, progress_bar: false) ⇒ PageExporter

Returns a new instance of PageExporter.



8
9
10
11
# File 'app/models/page_exporter.rb', line 8

def initialize(base_dir, progress_bar: false)
  @base_dir = base_dir
  @progress_bar = progress_bar
end

Instance Attribute Details

#base_dirObject (readonly)

Returns the value of attribute base_dir.



6
7
8
# File 'app/models/page_exporter.rb', line 6

def base_dir
  @base_dir
end

#progress_barObject (readonly)

Returns the value of attribute progress_bar.



6
7
8
# File 'app/models/page_exporter.rb', line 6

def progress_bar
  @progress_bar
end

Instance Method Details

#exportObject



13
14
15
# File 'app/models/page_exporter.rb', line 13

def export
  Page.roots.in_locale(I18n.default_locale).each { |p| export_page(p) }
end