Class: PagerTree::Integrations::Alert
- Inherits:
-
Object
- Object
- PagerTree::Integrations::Alert
- Extended by:
- ActiveModel::Callbacks
- Includes:
- ActiveModel::API, ActiveModel::Model
- Defined in:
- app/models/pager_tree/integrations/alert.rb
Instance Attribute Summary collapse
-
#additional_data ⇒ Object
Returns the value of attribute additional_data.
-
#attachments ⇒ Object
Returns the value of attribute attachments.
-
#dedup_keys ⇒ Object
Returns the value of attribute dedup_keys.
-
#description ⇒ Object
Returns the value of attribute description.
-
#incident ⇒ Object
Returns the value of attribute incident.
-
#incident_message ⇒ Object
Returns the value of attribute incident_message.
-
#incident_severity ⇒ Object
Returns the value of attribute incident_severity.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#thirdparty_id ⇒ Object
Returns the value of attribute thirdparty_id.
-
#title ⇒ Object
Returns the value of attribute title.
-
#urgency ⇒ Object
Returns the value of attribute urgency.
Instance Method Summary collapse
- #incident? ⇒ Boolean
-
#initialize(params = {}) ⇒ Alert
constructor
A new instance of Alert.
- #push_additional_data(additional_datum) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Alert
Returns a new instance of Alert.
28 29 30 31 32 |
# File 'app/models/pager_tree/integrations/alert.rb', line 28 def initialize(params = {}) run_callbacks :initialize do super(params) end end |
Instance Attribute Details
#additional_data ⇒ Object
Returns the value of attribute additional_data.
16 17 18 |
# File 'app/models/pager_tree/integrations/alert.rb', line 16 def additional_data @additional_data end |
#attachments ⇒ Object
Returns the value of attribute attachments.
17 18 19 |
# File 'app/models/pager_tree/integrations/alert.rb', line 17 def @attachments end |
#dedup_keys ⇒ Object
Returns the value of attribute dedup_keys.
15 16 17 |
# File 'app/models/pager_tree/integrations/alert.rb', line 15 def dedup_keys @dedup_keys end |
#description ⇒ Object
Returns the value of attribute description.
8 9 10 |
# File 'app/models/pager_tree/integrations/alert.rb', line 8 def description @description end |
#incident ⇒ Object
Returns the value of attribute incident.
10 11 12 |
# File 'app/models/pager_tree/integrations/alert.rb', line 10 def incident @incident end |
#incident_message ⇒ Object
Returns the value of attribute incident_message.
12 13 14 |
# File 'app/models/pager_tree/integrations/alert.rb', line 12 def @incident_message end |
#incident_severity ⇒ Object
Returns the value of attribute incident_severity.
11 12 13 |
# File 'app/models/pager_tree/integrations/alert.rb', line 11 def incident_severity @incident_severity end |
#meta ⇒ Object
Returns the value of attribute meta.
13 14 15 |
# File 'app/models/pager_tree/integrations/alert.rb', line 13 def @meta end |
#tags ⇒ Object
Returns the value of attribute tags.
18 19 20 |
# File 'app/models/pager_tree/integrations/alert.rb', line 18 def @tags end |
#thirdparty_id ⇒ Object
Returns the value of attribute thirdparty_id.
14 15 16 |
# File 'app/models/pager_tree/integrations/alert.rb', line 14 def thirdparty_id @thirdparty_id end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'app/models/pager_tree/integrations/alert.rb', line 7 def title @title end |
#urgency ⇒ Object
Returns the value of attribute urgency.
9 10 11 |
# File 'app/models/pager_tree/integrations/alert.rb', line 9 def urgency @urgency end |
Instance Method Details
#incident? ⇒ Boolean
49 50 51 |
# File 'app/models/pager_tree/integrations/alert.rb', line 49 def incident? ActiveModel::Type::Boolean.new.cast(self.incident) end |
#push_additional_data(additional_datum) ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'app/models/pager_tree/integrations/alert.rb', line 53 def push_additional_data(additional_datum) if additional_datum.valid? self.additional_data.push(additional_data.to_json) true else false end end |