Class: ForemanExpireHosts::Notification::Base
- Inherits:
-
Object
- Object
- ForemanExpireHosts::Notification::Base
- Defined in:
- app/services/foreman_expire_hosts/notification/base.rb
Direct Known Subclasses
DeletedHosts, ExpiryWarning, FailedDeletedHosts, FailedStoppedHosts, StoppedHosts
Instance Attribute Summary collapse
-
#all_hosts ⇒ Object
Returns the value of attribute all_hosts.
-
#global_recipients ⇒ Object
Returns the value of attribute global_recipients.
Instance Method Summary collapse
- #deliver ⇒ Object
-
#initialize(opts) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(opts) ⇒ Base
Returns a new instance of Base.
8 9 10 11 |
# File 'app/services/foreman_expire_hosts/notification/base.rb', line 8 def initialize(opts) @all_hosts = opts.fetch(:hosts) @global_recipients = [opts[:to]].flatten.compact end |
Instance Attribute Details
#all_hosts ⇒ Object
Returns the value of attribute all_hosts.
6 7 8 |
# File 'app/services/foreman_expire_hosts/notification/base.rb', line 6 def all_hosts @all_hosts end |
#global_recipients ⇒ Object
Returns the value of attribute global_recipients.
6 7 8 |
# File 'app/services/foreman_expire_hosts/notification/base.rb', line 6 def global_recipients @global_recipients end |
Instance Method Details
#deliver ⇒ Object
13 14 15 16 |
# File 'app/services/foreman_expire_hosts/notification/base.rb', line 13 def deliver deliver_mail_notifications if respond_to?(:build_mail_notification, true) deliver_ui_notifications if respond_to?(:build_ui_notification, true) end |