Class: Copyleaks::NaturalLanguageSubmissionModel
- Inherits:
-
AIDetectionSubmissionModel
- Object
- AIDetectionSubmissionModel
- Copyleaks::NaturalLanguageSubmissionModel
- Defined in:
- lib/copyleaks/models/submissions/ai_detection/natural_language_submission_model.rb
Instance Attribute Summary collapse
-
#language ⇒ Object
Returns the value of attribute language.
Attributes inherited from AIDetectionSubmissionModel
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(text, language = nil, sandbox = false) ⇒ NaturalLanguageSubmissionModel
constructor
A new instance of NaturalLanguageSubmissionModel.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(text, language = nil, sandbox = false) ⇒ NaturalLanguageSubmissionModel
Returns a new instance of NaturalLanguageSubmissionModel.
32 33 34 35 36 37 38 |
# File 'lib/copyleaks/models/submissions/ai_detection/natural_language_submission_model.rb', line 32 def initialize(text, language = nil, sandbox = false) unless text.instance_of?(String) raise 'Copyleaks::NaturalLanguageSubmissionModel - text - text must be of type String' end super(text, sandbox) @language = language end |
Instance Attribute Details
#language ⇒ Object
Returns the value of attribute language.
27 28 29 |
# File 'lib/copyleaks/models/submissions/ai_detection/natural_language_submission_model.rb', line 27 def language @language end |
Instance Method Details
#as_json(*_args) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/copyleaks/models/submissions/ai_detection/natural_language_submission_model.rb', line 40 def as_json(*_args) { text: @text, sandbox: @sandbox, language: @language }.select { |_k, v| !v.nil? } end |
#to_json(*options) ⇒ Object
48 49 50 |
# File 'lib/copyleaks/models/submissions/ai_detection/natural_language_submission_model.rb', line 48 def to_json(*) as_json(*).to_json(*) end |