Class: Copyleaks::Alerts
- Inherits:
-
Object
- Object
- Copyleaks::Alerts
- Defined in:
- lib/copyleaks/models/submissions/webhooks/HelperModels/NotificationsModels/Alerts.rb
Instance Attribute Summary collapse
-
#additionalData ⇒ Object
readonly
Returns the value of attribute additionalData.
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#helpLink ⇒ Object
readonly
Returns the value of attribute helpLink.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(category:, code:, title:, message:, helpLink:, severity:, additionalData:) ⇒ Alerts
constructor
A new instance of Alerts.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(category:, code:, title:, message:, helpLink:, severity:, additionalData:) ⇒ Alerts
Returns a new instance of Alerts.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NotificationsModels/Alerts.rb', line 31 def initialize(category:, code:, title:, message:, helpLink:, severity:, additionalData:) raise 'Copyleaks::Alerts - category must be a String' unless category.is_a?(String) raise 'Copyleaks::Alerts - code must be a String' unless code.is_a?(String) raise 'Copyleaks::Alerts - title must be a String' unless title.is_a?(String) raise 'Copyleaks::Alerts - message must be a String' unless .is_a?(String) raise 'Copyleaks::Alerts - helpLink must be a String' unless helpLink.is_a?(String) raise 'Copyleaks::Alerts - severity must be a String' unless severity.is_a?(String) raise 'Copyleaks::Alerts - additionalData must be a String' unless additionalData.is_a?(String) @category = category @code = code @title = title @message = @helpLink = helpLink @severity = severity @additionalData = additionalData end |
Instance Attribute Details
#additionalData ⇒ Object (readonly)
Returns the value of attribute additionalData.
22 23 24 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NotificationsModels/Alerts.rb', line 22 def additionalData @additionalData end |
#category ⇒ Object (readonly)
Returns the value of attribute category.
22 23 24 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NotificationsModels/Alerts.rb', line 22 def category @category end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
22 23 24 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NotificationsModels/Alerts.rb', line 22 def code @code end |
#helpLink ⇒ Object (readonly)
Returns the value of attribute helpLink.
22 23 24 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NotificationsModels/Alerts.rb', line 22 def helpLink @helpLink end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
22 23 24 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NotificationsModels/Alerts.rb', line 22 def @message end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity.
22 23 24 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NotificationsModels/Alerts.rb', line 22 def severity @severity end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
22 23 24 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NotificationsModels/Alerts.rb', line 22 def title @title end |
Instance Method Details
#as_json(*_args) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NotificationsModels/Alerts.rb', line 49 def as_json(*_args) { category: @category, code: @code, title: @title, message: @message, helpLink: @helpLink, severity: @severity, additionalData: @additionalData } end |
#to_json(*options) ⇒ Object
61 62 63 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NotificationsModels/Alerts.rb', line 61 def to_json(*) as_json(*).to_json(*) end |