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
3 4 5 |
# File 'app/jobs/export_job.rb', line 3 def base_uri @base_uri end |
#export ⇒ Object
Returns the value of attribute export
3 4 5 |
# File 'app/jobs/export_job.rb', line 3 def export @export end |
#filename ⇒ Object
Returns the value of attribute filename
3 4 5 |
# File 'app/jobs/export_job.rb', line 3 def filename @filename end |
#type ⇒ Object
Returns the value of attribute type
3 4 5 |
# File 'app/jobs/export_job.rb', line 3 def type @type end |
Instance Method Details
#error(job, exception) ⇒ Object
16 17 18 |
# File 'app/jobs/export_job.rb', line 16 def error(job, exception) export.fail!(exception) end |
#perform ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/jobs/export_job.rb', line 4 def perform strio = StringIO.new exporter = Iqvoc::SkosExporter.new(filename, type, base_uri, Logger.new(strio)) exporter.run @messages = strio.string end |
#success(job) ⇒ Object
12 13 14 |
# File 'app/jobs/export_job.rb', line 12 def success(job) export.finish!(@messages) end |