Class: Perchfall::Notify::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/perchfall/notify/channel.rb

Overview

Base interface for notification channels.

A channel is responsible for delivering a formatted message derived from a Perchfall::Report to an external destination (Slack, SMS, webhook, etc.).

Implement #deliver(report) in subclasses. Raise DeliveryError on failure.

Example:

class MyChannel < Perchfall::Notify::Channel
def deliver(report)
  # send the report somewhere
end
end

Direct Known Subclasses

Perchfall::Notify::Channels::Slack

Instance Method Summary collapse

Instance Method Details

#deliver(report) ⇒ Object

Deliver a notification for the given report.

Parameters:

  • report (Perchfall::Report)

Raises:

  • (NotImplementedError) —

    if subclass does not implement this method

  • (DeliveryError) —

    if delivery fails



25
26
27
# File 'lib/perchfall/notify/channel.rb', line 25

def deliver(report)
  raise NotImplementedError, "#{self.class}#deliver is not implemented"
end