Class: ExpireTicketJob

Inherits:
Struct
  • Object
show all
Defined in:
app/models/job/expire_ticket_job.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cart_idObject

Returns the value of attribute cart_id

Returns:

  • (Object)

    the current value of cart_id



1
2
3
# File 'app/models/job/expire_ticket_job.rb', line 1

def cart_id
  @cart_id
end

#ticket_idsObject

Returns the value of attribute ticket_ids

Returns:

  • (Object)

    the current value of ticket_ids



1
2
3
# File 'app/models/job/expire_ticket_job.rb', line 1

def ticket_ids
  @ticket_ids
end

Class Method Details

.enqueue(ticket_ids, cart_id) ⇒ Object



2
3
4
# File 'app/models/job/expire_ticket_job.rb', line 2

def self.enqueue(ticket_ids, cart_id)
  Delayed::Job.enqueue(ExpireTicketJob.new(ticket_ids, cart_id), :run_at => 10.minutes.from_now, :queue => "ticket")
end

Instance Method Details

#performObject



6
7
8
# File 'app/models/job/expire_ticket_job.rb', line 6

def perform
  Ticket.unlock(ticket_ids, cart_id)
end