Class: ActiveNotifier::AbstractAdapter
- Inherits:
-
Object
- Object
- ActiveNotifier::AbstractAdapter
- Defined in:
- lib/active_notifier/adapters/abstract_adapter.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
Instance Method Summary collapse
-
#initialize(adapter_class) ⇒ AbstractAdapter
constructor
A new instance of AbstractAdapter.
-
#notify(token, type, message, **options) ⇒ Object
abstract
Notify message.
Constructor Details
#initialize(adapter_class) ⇒ AbstractAdapter
Returns a new instance of AbstractAdapter.
5 6 7 |
# File 'lib/active_notifier/adapters/abstract_adapter.rb', line 5 def initialize(adapter_class) @adapter = adapter_class.new end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
3 4 5 |
# File 'lib/active_notifier/adapters/abstract_adapter.rb', line 3 def adapter @adapter end |
Instance Method Details
#notify(token, type, message, **options) ⇒ Object
This method is abstract.
Implement through setting a real adapter, like :dingtalk
Notify message
20 21 22 |
# File 'lib/active_notifier/adapters/abstract_adapter.rb', line 20 def notify(token, type, , **) adapter.notify(token, type, , **) end |