Class: Webhookdb::Messages::ErrorIcalendarFetch

Inherits:
Webhookdb::Message::Template show all
Defined in:
lib/webhookdb/messages/error_icalendar_fetch.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Webhookdb::Message::Template

#dispatch, #dispatch_email, #extra_fields, #full_template_name, #layout, #layout_path, #liquify, #template_path

Constructor Details

#initialize(service_integration, external_calendar_id, request_url:, request_method:, response_status:, response_body:) ⇒ ErrorIcalendarFetch

Returns a new instance of ErrorIcalendarFetch.



12
13
14
15
16
17
18
19
20
21
# File 'lib/webhookdb/messages/error_icalendar_fetch.rb', line 12

def initialize(service_integration, external_calendar_id, request_url:, request_method:, response_status:,
  response_body:)
  @service_integration = service_integration
  @external_calendar_id = external_calendar_id
  @request_url = request_url
  @request_method = request_method
  @response_status = response_status
  @response_body = response_body
  super()
end

Class Method Details

.fixtured(_recipient) ⇒ Object



6
7
8
9
10
# File 'lib/webhookdb/messages/error_icalendar_fetch.rb', line 6

def self.fixtured(_recipient)
  sint = Webhookdb::Fixtures.service_integration.create
  return self.new(sint, "calendar123",
                  response_status: 403, request_url: "/foo", request_method: "GET", response_body: "hi",)
end

Instance Method Details

#liquid_dropsObject



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/webhookdb/messages/error_icalendar_fetch.rb', line 30

def liquid_drops
  return super.merge(
    service_name: @service_integration.service_name,
    opaque_id: @service_integration.opaque_id,
    request_method: @request_method,
    request_url: @request_url,
    response_status: @response_status,
    response_body: @response_body,
    external_calendar_id: @external_calendar_id,
  )
end

#signatureObject



23
24
25
# File 'lib/webhookdb/messages/error_icalendar_fetch.rb', line 23

def signature
  return "msg-#{self.full_template_name}-sint:#{@service_integration.id}-eid:#{@external_calendar_id}"
end

#template_folderObject



27
# File 'lib/webhookdb/messages/error_icalendar_fetch.rb', line 27

def template_folder = "errors"

#template_nameObject



28
# File 'lib/webhookdb/messages/error_icalendar_fetch.rb', line 28

def template_name = "icalendar_fetch"