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) ⇒ PageExporter

Returns a new instance of PageExporter.



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

def initialize(base_dir)
  @base_dir = base_dir
end

Instance Attribute Details

#base_dirObject (readonly)

Returns the value of attribute base_dir.



4
5
6
# File 'app/models/page_exporter.rb', line 4

def base_dir
  @base_dir
end

Instance Method Details

#exportObject



10
11
12
13
# File 'app/models/page_exporter.rb', line 10

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