Class: Vero::SuckerPunchWorker

Inherits:
Object
  • Object
show all
Includes:
SuckerPunch::Job
Defined in:
lib/vero/senders/sucker_punch.rb

Instance Method Summary collapse

Instance Method Details

#perform(api_class, domain, options) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/vero/senders/sucker_punch.rb', line 10

def perform(api_class, domain, options)
  new_options = {}
  options.each { |k, v| new_options[k.to_sym] = v }

  begin
    api_class.new(domain, new_options).perform
    Vero::App.log(self, "method: #{api_class.name}, options: #{options.to_json}, response: job performed")
  rescue StandardError => e
    Vero::App.log(self, "method: #{api_class.name}, options: #{options.to_json}, response: #{e.message}")
  end
end