Class: Copyleaks::TextModerationScannedDocument
- Inherits:
-
Object
- Object
- Copyleaks::TextModerationScannedDocument
- Defined in:
- lib/copyleaks/models/textModeration/responses/submodules/TextModerationScannedDocument.rb
Instance Attribute Summary collapse
-
#actual_credits ⇒ Object
Returns the value of attribute actual_credits.
-
#creation_time ⇒ Object
Returns the value of attribute creation_time.
-
#expected_credits ⇒ Object
Returns the value of attribute expected_credits.
-
#scan_id ⇒ Object
Returns the value of attribute scan_id.
-
#total_excluded ⇒ Object
Returns the value of attribute total_excluded.
-
#total_words ⇒ Object
Returns the value of attribute total_words.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(scan_id: '', total_words: 0, total_excluded: 0, actual_credits: 0, expected_credits: 0, creation_time: Time.utc.now) ⇒ TextModerationScannedDocument
constructor
A new instance of TextModerationScannedDocument.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(scan_id: '', total_words: 0, total_excluded: 0, actual_credits: 0, expected_credits: 0, creation_time: Time.utc.now) ⇒ TextModerationScannedDocument
Returns a new instance of TextModerationScannedDocument.
14 15 16 17 18 19 20 21 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationScannedDocument.rb', line 14 def initialize(scan_id: '', total_words: 0, total_excluded: 0, actual_credits: 0, expected_credits: 0, creation_time: Time.utc.now) @scan_id = scan_id @total_words = total_words @total_excluded = total_excluded @actual_credits = actual_credits @expected_credits = expected_credits @creation_time = creation_time end |
Instance Attribute Details
#actual_credits ⇒ Object
Returns the value of attribute actual_credits.
6 7 8 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationScannedDocument.rb', line 6 def actual_credits @actual_credits end |
#creation_time ⇒ Object
Returns the value of attribute creation_time.
6 7 8 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationScannedDocument.rb', line 6 def creation_time @creation_time end |
#expected_credits ⇒ Object
Returns the value of attribute expected_credits.
6 7 8 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationScannedDocument.rb', line 6 def expected_credits @expected_credits end |
#scan_id ⇒ Object
Returns the value of attribute scan_id.
6 7 8 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationScannedDocument.rb', line 6 def scan_id @scan_id end |
#total_excluded ⇒ Object
Returns the value of attribute total_excluded.
6 7 8 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationScannedDocument.rb', line 6 def total_excluded @total_excluded end |
#total_words ⇒ Object
Returns the value of attribute total_words.
6 7 8 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationScannedDocument.rb', line 6 def total_words @total_words end |
Class Method Details
.from_json(json_string) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationScannedDocument.rb', line 35 def self.from_json(json_string) data = JSON.parse(json_string, symbolize_names: true) new( scan_id: data[:scanId], total_words: data[:totalWords], total_excluded: data[:totalExcluded], actual_credits: data[:actualCredits], expected_credits: data[:expectedCredits], creation_time: Time.parse(data[:creationTime]) ) end |
Instance Method Details
#to_json(options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationScannedDocument.rb', line 24 def to_json( = {}) { scanId: @scan_id, totalWords: @total_words, totalExcluded: @total_excluded, actualCredits: @actual_credits, expectedCredits: @expected_credits, creationTime: @creation_time.iso8601 }.to_json() end |