Class: OpenC3::NotificationModel

Inherits:
Object
  • Object
show all
Defined in:
lib/openc3/models/notification_model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



25
26
27
# File 'lib/openc3/models/notification_model.rb', line 25

def body
  @body
end

#severityObject (readonly)

Returns the value of attribute severity.



25
26
27
# File 'lib/openc3/models/notification_model.rb', line 25

def severity
  @severity
end

#timeObject (readonly)

Returns the value of attribute time.



25
26
27
# File 'lib/openc3/models/notification_model.rb', line 25

def time
  @time
end

#titleObject (readonly)

Returns the value of attribute title.



25
26
27
# File 'lib/openc3/models/notification_model.rb', line 25

def title
  @title
end

#urlObject (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