Class: Copyleaks::SubmissionAiGeneratedText

Inherits:
Object
  • Object
show all
Defined in:
lib/copyleaks/models/submissions/properties/ai_generated_text.rb

Instance Method Summary collapse

Constructor Details

#initialize(detect = false) ⇒ SubmissionAiGeneratedText

Returns a new instance of SubmissionAiGeneratedText.

Parameters:

  • detect (Boolean) (defaults to: false)

    Detects whether the text was written by an AI.



27
28
29
30
31
# File 'lib/copyleaks/models/submissions/properties/ai_generated_text.rb', line 27

def initialize(
  detect = false
)
  @detect = detect
end

Instance Method Details

#as_json(*_args) ⇒ Object



33
34
35
36
37
# File 'lib/copyleaks/models/submissions/properties/ai_generated_text.rb', line 33

def as_json(*_args)
  {
    detect: @detect
  }.select { |_k, v| !v.nil? }
end

#to_json(*options) ⇒ Object



39
40
41
# File 'lib/copyleaks/models/submissions/properties/ai_generated_text.rb', line 39

def to_json(*options)
  as_json(*options).to_json(*options)
end