Class: Copyleaks::CopyleaksAiImageDetectionSummaryModel
- Inherits:
-
Object
- Object
- Copyleaks::CopyleaksAiImageDetectionSummaryModel
- Defined in:
- lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionSummaryModel.rb
Overview
Summary statistics of the AI detection analysis.
Instance Attribute Summary collapse
-
#ai ⇒ Object
Percentage of pixels suspected to be AI-generated.
-
#human ⇒ Object
Percentage of pixels suspected to be human-created.
Class Method Summary collapse
-
.from_json(json_hash) ⇒ Object
Create instance from JSON hash.
Instance Method Summary collapse
-
#initialize(human: nil, ai: nil) ⇒ CopyleaksAiImageDetectionSummaryModel
constructor
Initialize a new CopyleaksAiImageDetectionSummaryModel.
-
#to_json(*args) ⇒ Object
Convert to JSON.
Constructor Details
#initialize(human: nil, ai: nil) ⇒ CopyleaksAiImageDetectionSummaryModel
Initialize a new CopyleaksAiImageDetectionSummaryModel
42 43 44 45 |
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionSummaryModel.rb', line 42 def initialize(human: nil, ai: nil) @human = human @ai = ai end |
Instance Attribute Details
#ai ⇒ Object
Percentage of pixels suspected to be AI-generated. Range: 0.0-1.0
36 37 38 |
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionSummaryModel.rb', line 36 def ai @ai end |
#human ⇒ Object
Percentage of pixels suspected to be human-created. Range: 0.0-1.0
32 33 34 |
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionSummaryModel.rb', line 32 def human @human end |
Class Method Details
.from_json(json_hash) ⇒ Object
Create instance from JSON hash
48 49 50 51 52 53 54 55 |
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionSummaryModel.rb', line 48 def self.from_json(json_hash) return nil if json_hash.nil? new( human: json_hash['human'], ai: json_hash['ai'] ) end |
Instance Method Details
#to_json(*args) ⇒ Object
Convert to JSON
58 59 60 61 62 63 |
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionSummaryModel.rb', line 58 def to_json(*args) { 'human' => @human, 'ai' => @ai }.to_json(*args) end |