Module: Perchfall::Notify

Defined in:
lib/perchfall/notify.rb,
lib/perchfall/notify/errors.rb,
lib/perchfall/notify/channel.rb,
lib/perchfall/notify/version.rb,
lib/perchfall/notify/notifier.rb,
lib/perchfall/notify/channels/slack.rb,
lib/perchfall/notify/net_http_client.rb,
lib/perchfall/notify/slack_formatter.rb

Defined Under Namespace

Modules: Channels Classes: Channel, NetHttpClient, Notifier, SlackFormatter

Constant Summary collapse

Error =

Base error for all perchfall-notify failures.

Class.new(StandardError)
DeliveryError =

Raised when a channel fails to deliver a notification.

Class.new(Error)
ConfigurationError =

Raised when a channel is constructed with invalid configuration.

Class.new(Error)
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.deliver(report, channels:) ⇒ Object

Convenience method. Delivers a report to one or more channels.

Perchfall::Notify.deliver(report, channels: [slack_channel])

Parameters:

  • report (Perchfall::Report)
  • channels (Array<Channel>)


21
22
23
# File 'lib/perchfall/notify.rb', line 21

def self.deliver(report, channels:)
  Notifier.new(channels: channels).notify(report)
end