Module: SmSmsCampaignWebhook

Defined in:
lib/sm_sms_campaign_webhook.rb,
lib/sm_sms_campaign_webhook/engine.rb,
lib/sm_sms_campaign_webhook/version.rb,
app/exceptions/sm_sms_campaign_webhook/error.rb,
app/jobs/sm_sms_campaign_webhook/application_job.rb,
app/processors/sm_sms_campaign_webhook/processable.rb,
app/jobs/sm_sms_campaign_webhook/dispatch_payload_job.rb,
app/exceptions/sm_sms_campaign_webhook/invalid_payload.rb,
app/models/sm_sms_campaign_webhook/campaign_engagement.rb,
app/operations/sm_sms_campaign_webhook/payload_operation.rb,
app/processors/sm_sms_campaign_webhook/default_processor.rb,
app/controllers/sm_sms_campaign_webhook/webhook_controller.rb,
app/exceptions/sm_sms_campaign_webhook/missing_config_error.rb,
app/exceptions/sm_sms_campaign_webhook/invalid_payload_value.rb,
app/exceptions/sm_sms_campaign_webhook/payload_dispatch_error.rb,
app/models/sm_sms_campaign_webhook/campaign_engagement/answer.rb,
app/controllers/sm_sms_campaign_webhook/application_controller.rb,
app/jobs/sm_sms_campaign_webhook/process_campaign_engagement_job.rb,
lib/generators/sm_sms_campaign_webhook/install/install_generator.rb,
app/operations/sm_sms_campaign_webhook/campaign_engagement_operation.rb

Overview

Namespace for SMS campaign webhook.

Defined Under Namespace

Modules: Generators, Processable Classes: ApplicationController, ApplicationJob, CampaignEngagement, CampaignEngagementOperation, DefaultProcessor, DispatchPayloadJob, Engine, Error, InvalidPayload, InvalidPayloadValue, MissingConfigError, PayloadDispatchError, PayloadOperation, ProcessCampaignEngagementJob, WebhookController

Constant Summary collapse

VERSION =

Returns gem version.

Returns:

  • (String)

    gem version

"2.0.1"

Class Method Summary collapse

Class Method Details

.auth_tokenString

Returns SMS campaign webhook auth token.

Returns:

  • (String)

    SMS campaign webhook auth token

Raises:

  • (MissingConfigError)

    when ENV does not contain SM_SMS_CAMPAIGN_WEBHOOK_AUTH_TOKEN value


15
16
17
18
19
20
# File 'lib/sm_sms_campaign_webhook.rb', line 15

def self.auth_token
  @auth_token ||= ENV.fetch("SM_SMS_CAMPAIGN_WEBHOOK_AUTH_TOKEN") {
    raise MissingConfigError,
      "ENV does not contain SM_SMS_CAMPAIGN_WEBHOOK_AUTH_TOKEN value"
  }
end

.config {|_self| ... } ⇒ SmSmsCampaignWebhook

Returns self for configuration purposes.

Yields:

  • (_self)

Yield Parameters:

Returns:


9
10
11
# File 'lib/sm_sms_campaign_webhook.rb', line 9

def self.config(&block)
  yield self if block
end

.processorProcessable

Returns SMS campaign payload processor used by operations.

Returns:

  • (Processable)

    SMS campaign payload processor used by operations


23
24
25
# File 'lib/sm_sms_campaign_webhook.rb', line 23

def self.processor
  @processor ||= DefaultProcessor
end

.processor=(processor) ⇒ Object

Parameters:

  • processor (Processable)

    Custom SMS campaign payload processor

See Also:


29
30
31
# File 'lib/sm_sms_campaign_webhook.rb', line 29

def self.processor=(processor)
  @processor = processor
end