Module: Webhooks

Defined in:
lib/webhooks.rb,
lib/webhooks/engine.rb,
lib/webhooks/version.rb,
app/models/webhooks/event.rb,
app/models/webhooks/attempt.rb,
app/models/webhooks/request.rb,
app/models/webhooks/endpoint.rb,
app/models/webhooks/response.rb,
app/jobs/webhooks/deliver_job.rb,
app/jobs/webhooks/application_job.rb,
app/models/webhooks/event_serializer.rb,
app/models/webhooks/application_record.rb,
app/helpers/webhooks/application_helper.rb,
app/mailers/webhooks/application_mailer.rb,
app/controllers/webhooks/events_controller.rb,
app/controllers/webhooks/attempts_controller.rb,
app/controllers/webhooks/endpoints_controller.rb,
app/controllers/webhooks/application_controller.rb

Defined Under Namespace

Modules: ApplicationHelper Classes: ApplicationController, ApplicationJob, ApplicationMailer, ApplicationRecord, Attempt, AttemptsController, DeliverJob, Endpoint, EndpointsController, Engine, Event, EventSerializer, EventsController, Request, Response

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.clientObject



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

def self.client
  @client ||= Faraday.new do |conn|
    conn.headers[:user_agent] = Rails.application.config.webhooks.user_agent
    conn.headers[:content_type] = 'application/json'
    conn.headers[:accept] = 'application/json'

    conn.request :json

    conn.options.timeout = Rails.application.config.webhooks.requests.read_timeout
    conn.options.open_timeout = Rails.application.config.webhooks.requests.open_timeout
  end
end