Class: Postdoc::Job
- Inherits:
-
Object
- Object
- Postdoc::Job
- Defined in:
- lib/postdoc/job.rb
Overview
A job is a single “print” in a batch and binds a document to a setting.
Instance Method Summary collapse
- #cleanup ⇒ Object
-
#initialize(document, settings: PrintSettings.new) ⇒ Job
constructor
A new instance of Job.
-
#result(client) ⇒ Object
Return the result of the job.
Constructor Details
#initialize(document, settings: PrintSettings.new) ⇒ Job
Returns a new instance of Job.
4 5 6 7 |
# File 'lib/postdoc/job.rb', line 4 def initialize(document, settings: PrintSettings.new) @settings = settings @document = HTMLDocument.new(document) end |
Instance Method Details
#cleanup ⇒ Object
14 15 16 |
# File 'lib/postdoc/job.rb', line 14 def cleanup @document.cleanup end |
#result(client) ⇒ Object
Return the result of the job.
10 11 12 |
# File 'lib/postdoc/job.rb', line 10 def result(client) client.print_document(@document.path, settings: @settings) end |