Class: OpenC3::NotificationModel
- Defined in:
- lib/openc3/models/notification_model.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #as_json(*a) ⇒ Object
-
#initialize(time:, severity:, url:, title:, body:) ⇒ NotificationModel
constructor
A new instance of NotificationModel.
Constructor Details
#initialize(time:, severity:, url:, title:, body:) ⇒ NotificationModel
Returns a new instance of NotificationModel.
27 28 29 30 31 32 33 |
# File 'lib/openc3/models/notification_model.rb', line 27 def initialize(time:, severity:, url:, title:, body:) @time = time @severity = severity @url = url @title = title @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
25 26 27 |
# File 'lib/openc3/models/notification_model.rb', line 25 def body @body end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity.
25 26 27 |
# File 'lib/openc3/models/notification_model.rb', line 25 def severity @severity end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
25 26 27 |
# File 'lib/openc3/models/notification_model.rb', line 25 def time @time end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
25 26 27 |
# File 'lib/openc3/models/notification_model.rb', line 25 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
25 26 27 |
# File 'lib/openc3/models/notification_model.rb', line 25 def url @url end |
Instance Method Details
#as_json(*a) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/openc3/models/notification_model.rb', line 35 def as_json(*a) { "time" => @time, "severity" => @severity, "url" => @url, "title" => @title, "body" => @body } end |