Class: Copyleaks::AIDetectionSubmissionModel
- Inherits:
-
Object
- Object
- Copyleaks::AIDetectionSubmissionModel
- Defined in:
- lib/copyleaks/models/submissions/ai_detection/ai_detection_submission_model.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(text, sandbox = false) ⇒ AIDetectionSubmissionModel
constructor
A new instance of AIDetectionSubmissionModel.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(text, sandbox = false) ⇒ AIDetectionSubmissionModel
Returns a new instance of AIDetectionSubmissionModel.
31 32 33 34 35 36 37 |
# File 'lib/copyleaks/models/submissions/ai_detection/ai_detection_submission_model.rb', line 31 def initialize(text, sandbox = false) unless text.instance_of?(String) raise 'Copyleaks::AIDetectionSubmissionModel - text - text must be of type String' end @text = text @sandbox = sandbox end |
Instance Attribute Details
#sandbox ⇒ Object
Returns the value of attribute sandbox.
27 28 29 |
# File 'lib/copyleaks/models/submissions/ai_detection/ai_detection_submission_model.rb', line 27 def sandbox @sandbox end |
#text ⇒ Object
Returns the value of attribute text.
27 28 29 |
# File 'lib/copyleaks/models/submissions/ai_detection/ai_detection_submission_model.rb', line 27 def text @text end |
Instance Method Details
#as_json(*_args) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/copyleaks/models/submissions/ai_detection/ai_detection_submission_model.rb', line 39 def as_json(*_args) { 'text' => @text, 'sandbox' => @sandbox }.reject { |_, v| v.nil? } end |
#to_json(*options) ⇒ Object
46 47 48 |
# File 'lib/copyleaks/models/submissions/ai_detection/ai_detection_submission_model.rb', line 46 def to_json(*) as_json(*).to_json(*) end |