Class: Cosmos::NotificationModel
- Defined in:
- lib/cosmos/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 ⇒ 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.
24 25 26 27 28 29 30 |
# File 'lib/cosmos/models/notification_model.rb', line 24 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.
22 23 24 |
# File 'lib/cosmos/models/notification_model.rb', line 22 def body @body end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity.
22 23 24 |
# File 'lib/cosmos/models/notification_model.rb', line 22 def severity @severity end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
22 23 24 |
# File 'lib/cosmos/models/notification_model.rb', line 22 def time @time end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
22 23 24 |
# File 'lib/cosmos/models/notification_model.rb', line 22 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
22 23 24 |
# File 'lib/cosmos/models/notification_model.rb', line 22 def url @url end |
Instance Method Details
#as_json ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/cosmos/models/notification_model.rb', line 32 def as_json { "time" => @time, "severity" => @severity, "url" => @url, "title" => @title, "body" => @body } end |