Class: ExportJob
- Inherits:
-
Struct
- Object
- Struct
- ExportJob
- Defined in:
- app/jobs/export_job.rb
Instance Attribute Summary collapse
-
#base_uri ⇒ Object
Returns the value of attribute base_uri.
-
#export ⇒ Object
Returns the value of attribute export.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#base_uri ⇒ Object
Returns the value of attribute base_uri
1 2 3 |
# File 'app/jobs/export_job.rb', line 1 def base_uri @base_uri end |
#export ⇒ Object
Returns the value of attribute export
1 2 3 |
# File 'app/jobs/export_job.rb', line 1 def export @export end |
#filename ⇒ Object
Returns the value of attribute filename
1 2 3 |
# File 'app/jobs/export_job.rb', line 1 def filename @filename end |
#type ⇒ Object
Returns the value of attribute type
1 2 3 |
# File 'app/jobs/export_job.rb', line 1 def type @type end |
Instance Method Details
#error(job, exception) ⇒ Object
14 15 16 |
# File 'app/jobs/export_job.rb', line 14 def error(job, exception) export.fail!(exception) end |
#perform ⇒ Object
2 3 4 5 6 7 8 |
# File 'app/jobs/export_job.rb', line 2 def perform strio = StringIO.new exporter = SkosExporter.new(filename, type, base_uri, Logger.new(strio)) exporter.run @messages = strio.string end |
#success(job) ⇒ Object
10 11 12 |
# File 'app/jobs/export_job.rb', line 10 def success(job) export.finish!(@messages) end |