Class: UNotifier::Provider::ProviderBase
- Inherits:
-
Object
- Object
- UNotifier::Provider::ProviderBase
- Defined in:
- lib/provider/provider_base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #can_notify?(notification) ⇒ Boolean
-
#initialize(notification_conditions: []) ⇒ ProviderBase
constructor
A new instance of ProviderBase.
Constructor Details
#initialize(notification_conditions: []) ⇒ ProviderBase
Returns a new instance of ProviderBase.
4 5 6 |
# File 'lib/provider/provider_base.rb', line 4 def initialize(notification_conditions: []) @notification_conditions = notification_conditions end |
Instance Method Details
#can_notify?(notification) ⇒ Boolean
8 9 10 11 12 |
# File 'lib/provider/provider_base.rb', line 8 def can_notify?(notification) return true if @notification_conditions.empty? @notification_conditions.all? { |c| c.call(notification) } end |