Class: WebHooks::Events::ResendService

Inherits:
Object
  • Object
show all
Defined in:
app/services/web_hooks/events/resend_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(web_hook_log, current_user:) ⇒ ResendService

Returns a new instance of ResendService.



6
7
8
9
# File 'app/services/web_hooks/events/resend_service.rb', line 6

def initialize(web_hook_log, current_user:)
  @web_hook_log = web_hook_log
  @current_user = current_user
end

Instance Method Details

#executeObject



11
12
13
14
15
16
17
# File 'app/services/web_hooks/events/resend_service.rb', line 11

def execute
  return unauthorized_response unless authorized?
  return url_changed_response unless web_hook_log.url_current?

  web_hook_log.web_hook.execute(web_hook_log.request_data, web_hook_log.trigger,
    idempotency_key: web_hook_log.idempotency_key)
end