Class: RedAlert::Notification
- Inherits:
-
Object
- Object
- RedAlert::Notification
- Defined in:
- lib/red_alert/notification.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(subject, body) ⇒ Notification
constructor
A new instance of Notification.
Constructor Details
#initialize(subject, body) ⇒ Notification
Returns a new instance of Notification.
7 8 9 10 |
# File 'lib/red_alert/notification.rb', line 7 def initialize(subject, body) @subject = subject @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/red_alert/notification.rb', line 5 def body @body end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
5 6 7 |
# File 'lib/red_alert/notification.rb', line 5 def subject @subject end |
Class Method Details
.build(subject_template, body_template, exception, data = {}) ⇒ Object
13 14 15 16 17 |
# File 'lib/red_alert/notification.rb', line 13 def build(subject_template, body_template, exception, data = {}) subject = compile_subject subject_template, exception body = compile_body body_template, exception, data self.new subject, body end |