Sha256: 0c1e0de4576c826662abf47a73953207a83bdf7ef2dc74371604cb0efe888ebc

Contents?: true

Size: 508 Bytes

Versions: 7

Compression:

Stored size: 508 Bytes

Contents

require 'rest-client'

Application.load 'lib/smartkiosk/sidekiq'

module Orders
  class AcknowledgeWorker
    include Sidekiq::Worker

    sidekiq_options :queue => :orders

    def perform(order_id, error=nil, percent=nil)
      order = Order.find(order_id)

      response = RestClient.post "#{Terminal.config.host}/terminal_orders/#{order.foreign_id}/acknowledge",
        :terminal => Terminal.keyword,
        :error    => error,
        :percent  => percent

      order.acknowledged!
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
smartkiosk-client-0.0.10 app/workers/orders/acknowledge_worker.rb
smartkiosk-client-0.0.9 app/workers/orders/acknowledge_worker.rb
smartkiosk-client-0.0.8 app/workers/orders/acknowledge_worker.rb
smartkiosk-client-0.0.7 app/workers/orders/acknowledge_worker.rb
smartkiosk-client-0.0.6 app/workers/orders/acknowledge_worker.rb
smartkiosk-client-0.0.5 app/workers/orders/acknowledge_worker.rb
smartkiosk-client-0.0.4 app/workers/orders/acknowledge_worker.rb