Class: Webhookdb::Jobs::IncreaseEventHandler

Inherits:
Object
  • Object
show all
Extended by:
Async::Job
Defined in:
lib/webhookdb/jobs/increase_event_handler.rb

Instance Method Summary collapse

Methods included from Async::Job

extended

Instance Method Details

#_perform(event) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/webhookdb/jobs/increase_event_handler.rb', line 10

def _perform(event)
  self.set_job_tags(increase_event_name: event.name)
  case event.name
    when "increase.oauth_connection.deactivated"
      conn_id = event.payload[0].fetch("associated_object_id")
      self.set_job_tags(result: "increase_oauth_disconnected", oauth_connection_id: conn_id)
      Webhookdb::Oauth::IncreaseProvider.disconnect_oauth(conn_id)
    else
      self.set_job_tags(result: "increase_event_noop")
  end
end