Class: ActiveNotifier::NotifierAdapters::Abstract

Inherits:
ActiveAdapter::Abstract
  • Object
show all
Defined in:
lib/active_notifier/notifier_adapters/abstract.rb

Overview

Define the interface for ActiveNotifier::Notifier adapter

Instance Method Summary collapse

Instance Method Details

#notify(token, type, message, **options) ⇒ Object

This method is abstract.

Implement through setting a real adapter, like :dingtalk

Notify message

Parameters:

  • token (String)

    Channel webhook token

  • type (Symbol)

    Message type

  • message (String)

    Message body

  • options (Hash)

    Adapter message options, some adapters require some another options

Raises:

  • (AdapterOptionsInvalidError)
  • (AdapterTypeInvalidError)
  • (MessageBlankError)

See Also:

  • for usage


16
17
18
# File 'lib/active_notifier/notifier_adapters/abstract.rb', line 16

def notify(token, type, message, **options)
  adapter.notify(token, type, message, **options)
end