Class: Copyleaks::Error
- Inherits:
-
Object
- Object
- Copyleaks::Error
- Defined in:
- lib/copyleaks/models/submissions/webhooks/HelperModels/ErrorModels/Error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(code:, message:) ⇒ Error
constructor
A new instance of Error.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(code:, message:) ⇒ Error
Returns a new instance of Error.
27 28 29 30 31 32 33 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ErrorModels/Error.rb', line 27 def initialize(code:, message:) raise 'Copyleaks::Error - code must be an Integer' unless code.is_a?(Integer) raise 'Copyleaks::Error - message must be a String' unless .is_a?(String) @code = code @message = end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
23 24 25 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ErrorModels/Error.rb', line 23 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
23 24 25 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ErrorModels/Error.rb', line 23 def @message end |
Instance Method Details
#as_json(*_args) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ErrorModels/Error.rb', line 35 def as_json(*_args) { code: @code, message: @message } end |
#to_json(*options) ⇒ Object
42 43 44 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ErrorModels/Error.rb', line 42 def to_json(*) as_json(*).to_json(*) end |