Class: Tortoise::UploadJob
- Inherits:
-
Object
- Object
- Tortoise::UploadJob
- Defined in:
- lib/tortoise/jobs/upload_job.rb
Instance Attribute Summary collapse
-
#invoice_id ⇒ Object
readonly
Returns the value of attribute invoice_id.
Instance Method Summary collapse
-
#initialize(invoice_id) ⇒ UploadJob
constructor
A new instance of UploadJob.
- #perform ⇒ Object
- #perform_in(delay = 0) ⇒ Object
- #perform_now ⇒ Object
Constructor Details
#initialize(invoice_id) ⇒ UploadJob
Returns a new instance of UploadJob.
5 6 7 |
# File 'lib/tortoise/jobs/upload_job.rb', line 5 def initialize(invoice_id) @invoice_id = invoice_id end |
Instance Attribute Details
#invoice_id ⇒ Object (readonly)
Returns the value of attribute invoice_id.
3 4 5 |
# File 'lib/tortoise/jobs/upload_job.rb', line 3 def invoice_id @invoice_id end |
Instance Method Details
#perform ⇒ Object
21 22 23 |
# File 'lib/tortoise/jobs/upload_job.rb', line 21 def perform perform_in end |
#perform_in(delay = 0) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/tortoise/jobs/upload_job.rb', line 13 def perform_in(delay=0) Thread.new do sleep delay process end end |
#perform_now ⇒ Object
9 10 11 |
# File 'lib/tortoise/jobs/upload_job.rb', line 9 def perform_now process end |