Class: Keys::ExpiryNotificationService
- Inherits:
-
BaseService
- Object
- BaseService
- Keys::ExpiryNotificationService
- Defined in:
- app/services/keys/expiry_notification_service.rb
Instance Attribute Summary collapse
-
#expiring_soon ⇒ Object
Returns the value of attribute expiring_soon.
-
#keys ⇒ Object
Returns the value of attribute keys.
Attributes inherited from BaseService
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(user, params) ⇒ ExpiryNotificationService
constructor
A new instance of ExpiryNotificationService.
Methods inherited from BaseService
Constructor Details
#initialize(user, params) ⇒ ExpiryNotificationService
Returns a new instance of ExpiryNotificationService.
7 8 9 10 11 12 |
# File 'app/services/keys/expiry_notification_service.rb', line 7 def initialize(user, params) @keys = params[:keys] @expiring_soon = params[:expiring_soon] super end |
Instance Attribute Details
#expiring_soon ⇒ Object
Returns the value of attribute expiring_soon.
5 6 7 |
# File 'app/services/keys/expiry_notification_service.rb', line 5 def expiring_soon @expiring_soon end |
#keys ⇒ Object
Returns the value of attribute keys.
5 6 7 |
# File 'app/services/keys/expiry_notification_service.rb', line 5 def keys @keys end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/services/keys/expiry_notification_service.rb', line 14 def execute return unless allowed? if expiring_soon trigger_expiring_soon_notification else trigger_expired_notification end end |