Class: Copyleaks::Task
- Inherits:
-
Object
- Object
- Copyleaks::Task
- Defined in:
- lib/copyleaks/models/submissions/webhooks/HelperModels/ExportModels/Task.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#httpStatusCode ⇒ Object
readonly
Returns the value of attribute httpStatusCode.
-
#isHealthy ⇒ Object
readonly
Returns the value of attribute isHealthy.
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(endpoint:, isHealthy:, httpStatusCode:) ⇒ Task
constructor
A new instance of Task.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(endpoint:, isHealthy:, httpStatusCode:) ⇒ Task
Returns a new instance of Task.
27 28 29 30 31 32 33 34 35 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ExportModels/Task.rb', line 27 def initialize(endpoint:, isHealthy:, httpStatusCode:) raise 'Copyleaks::Task - endpoint must be a String' unless endpoint.is_a?(String) raise 'Copyleaks::Task - isHealthy must be a Boolean' unless [true, false].include?(isHealthy) raise 'Copyleaks::Task - httpStatusCode must be an Integer' unless httpStatusCode.is_a?(Integer) @endpoint = endpoint @isHealthy = isHealthy @httpStatusCode = httpStatusCode end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
22 23 24 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ExportModels/Task.rb', line 22 def endpoint @endpoint end |
#httpStatusCode ⇒ Object (readonly)
Returns the value of attribute httpStatusCode.
22 23 24 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ExportModels/Task.rb', line 22 def httpStatusCode @httpStatusCode end |
#isHealthy ⇒ Object (readonly)
Returns the value of attribute isHealthy.
22 23 24 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ExportModels/Task.rb', line 22 def isHealthy @isHealthy end |
Instance Method Details
#as_json(*_args) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ExportModels/Task.rb', line 37 def as_json(*_args) { endpoint: @endpoint, isHealthy: @isHealthy, httpStatusCode: @httpStatusCode } end |
#to_json(*options) ⇒ Object
45 46 47 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ExportModels/Task.rb', line 45 def to_json(*) as_json(*).to_json(*) end |