Class: ImportJob
- Inherits:
-
Struct
- Object
- Struct
- ImportJob
- Defined in:
- app/jobs/import_job.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#import ⇒ Object
Returns the value of attribute import.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#publish ⇒ Object
Returns the value of attribute publish.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename
3 4 5 |
# File 'app/jobs/import_job.rb', line 3 def filename @filename end |
#import ⇒ Object
Returns the value of attribute import
3 4 5 |
# File 'app/jobs/import_job.rb', line 3 def import @import end |
#namespace ⇒ Object
Returns the value of attribute namespace
3 4 5 |
# File 'app/jobs/import_job.rb', line 3 def namespace @namespace end |
#publish ⇒ Object
Returns the value of attribute publish
3 4 5 |
# File 'app/jobs/import_job.rb', line 3 def publish @publish end |
#user ⇒ Object
Returns the value of attribute user
3 4 5 |
# File 'app/jobs/import_job.rb', line 3 def user @user end |
Instance Method Details
#error(job, exception) ⇒ Object
16 17 18 |
# File 'app/jobs/import_job.rb', line 16 def error(job, exception) import.fail!(exception) end |
#perform ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/jobs/import_job.rb', line 4 def perform strio = StringIO.new importer = Iqvoc::SkosImporter.new(filename, namespace, Logger.new(strio), publish) importer.run @messages = strio.string end |
#success(job) ⇒ Object
12 13 14 |
# File 'app/jobs/import_job.rb', line 12 def success(job) import.finish!(@messages) end |