Class: Tortoise::UploadJob

Inherits:
Object
  • Object
show all
Defined in:
lib/tortoise/jobs/upload_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject (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

#performObject



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_nowObject



9
10
11
# File 'lib/tortoise/jobs/upload_job.rb', line 9

def perform_now
  process
end