Class: SystemdMon::Notification
- Inherits:
-
Object
- Object
- SystemdMon::Notification
- Defined in:
- lib/systemd_mon/notification.rb
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hostname, unit) ⇒ Notification
constructor
A new instance of Notification.
- #type_text ⇒ Object
Constructor Details
#initialize(hostname, unit) ⇒ Notification
5 6 7 8 9 |
# File 'lib/systemd_mon/notification.rb', line 5 def initialize(hostname, unit) self.hostname = hostname self.unit = unit self.type = determine_type end |
Instance Attribute Details
#hostname ⇒ Object
Returns the value of attribute hostname.
3 4 5 |
# File 'lib/systemd_mon/notification.rb', line 3 def hostname @hostname end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/systemd_mon/notification.rb', line 3 def type @type end |
#unit ⇒ Object
Returns the value of attribute unit.
3 4 5 |
# File 'lib/systemd_mon/notification.rb', line 3 def unit @unit end |
Class Method Details
.types ⇒ Object
11 12 13 |
# File 'lib/systemd_mon/notification.rb', line 11 def self.types [:alert, :warning, :info, :ok] end |
Instance Method Details
#type_text ⇒ Object
15 16 17 |
# File 'lib/systemd_mon/notification.rb', line 15 def type_text type.to_s.capitalize end |