class Copyleaks::AIDetectionSubmissionModel

Attributes

sandbox[RW]
text[RW]

Public Class Methods

new(text, sandbox = false) click to toggle source

@param [String] A text string. @param [Boolean] Use sandbox mode to test your integration with the Copyleaks API for free.

# 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

Public Instance Methods

as_json(*_args) click to toggle source
# 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) click to toggle source
# File lib/copyleaks/models/submissions/ai_detection/ai_detection_submission_model.rb, line 46
def to_json(*options)
  as_json(*options).to_json(*options)
end