Class: Railspress::PostExportProcessor
- Inherits:
-
Object
- Object
- Railspress::PostExportProcessor
- Defined in:
- app/models/railspress/post_export_processor.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#export ⇒ Object
readonly
Returns the value of attribute export.
-
#export_dir ⇒ Object
readonly
Returns the value of attribute export_dir.
Instance Method Summary collapse
-
#initialize(export:) ⇒ PostExportProcessor
constructor
A new instance of PostExportProcessor.
- #process! ⇒ Object
Constructor Details
#initialize(export:) ⇒ PostExportProcessor
Returns a new instance of PostExportProcessor.
8 9 10 11 12 |
# File 'app/models/railspress/post_export_processor.rb', line 8 def initialize(export:) @export = export @errors = [] @export_dir = nil end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'app/models/railspress/post_export_processor.rb', line 6 def errors @errors end |
#export ⇒ Object (readonly)
Returns the value of attribute export.
6 7 8 |
# File 'app/models/railspress/post_export_processor.rb', line 6 def export @export end |
#export_dir ⇒ Object (readonly)
Returns the value of attribute export_dir.
6 7 8 |
# File 'app/models/railspress/post_export_processor.rb', line 6 def export_dir @export_dir end |
Instance Method Details
#process! ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/models/railspress/post_export_processor.rb', line 14 def process! export.mark_processing! setup_export_directory export_all_posts create_zip_file if export.error_count > 0 && export.success_count == 0 export.mark_failed! else export.mark_completed! end ensure cleanup_export_directory end |