Class: ImportExport::CategoryStructureExporter
- Inherits:
-
BaseExporter
- Object
- BaseExporter
- ImportExport::CategoryStructureExporter
- Defined in:
- lib/import_export/category_structure_exporter.rb
Constant Summary
Constants inherited from BaseExporter
BaseExporter::CATEGORY_ATTRS, BaseExporter::GROUP_ATTRS, BaseExporter::POST_ATTRS, BaseExporter::TOPIC_ATTRS, BaseExporter::USER_ATTRS
Instance Attribute Summary
Attributes inherited from BaseExporter
Instance Method Summary collapse
- #default_filename_prefix ⇒ Object
-
#initialize(include_group_users = false) ⇒ CategoryStructureExporter
constructor
A new instance of CategoryStructureExporter.
- #perform ⇒ Object
Methods inherited from BaseExporter
#categories, #export_categories, #export_categories!, #export_category_groups, #export_category_groups!, #export_group_users, #export_group_users!, #export_groups, #export_groups!, #export_topic_users, #export_topic_users!, #export_topics, #export_topics!, #export_translation_overrides, #export_users, #save_to_file
Constructor Details
#initialize(include_group_users = false) ⇒ CategoryStructureExporter
Returns a new instance of CategoryStructureExporter.
5 6 7 8 9 10 |
# File 'lib/import_export/category_structure_exporter.rb', line 5 def initialize(include_group_users = false) @include_group_users = include_group_users @export_data = { groups: [], categories: [] } @export_data[:users] = [] if @include_group_users end |
Instance Method Details
#default_filename_prefix ⇒ Object
21 22 23 |
# File 'lib/import_export/category_structure_exporter.rb', line 21 def default_filename_prefix "category-structure-export" end |
#perform ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/import_export/category_structure_exporter.rb', line 12 def perform puts "Exporting all the categories...", "" export_categories! export_category_groups! export_group_users! if @include_group_users self end |