Class: Copyleaks::CopyleaksFileOcrSubmissionModel
- Inherits:
-
CopyleaksFileSubmissionModel
- Object
- CopyleaksSubmissionModel
- CopyleaksFileSubmissionModel
- Copyleaks::CopyleaksFileOcrSubmissionModel
- Defined in:
- lib/copyleaks/models/submissions/file_ocr_submission_model.rb
Instance Attribute Summary
Attributes inherited from CopyleaksSubmissionModel
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(langCode, base64, filename, properties) ⇒ CopyleaksFileOcrSubmissionModel
constructor
A new instance of CopyleaksFileOcrSubmissionModel.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(langCode, base64, filename, properties) ⇒ CopyleaksFileOcrSubmissionModel
Returns a new instance of CopyleaksFileOcrSubmissionModel.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/copyleaks/models/submissions/file_ocr_submission_model.rb', line 30 def initialize(langCode, base64, filename, properties) unless langCode.instance_of?(String) raise 'Copyleaks::CopyleaksFileOcrSubmissionModel - langCode - langCode must be of type String' end unless base64.instance_of?(String) raise 'Copyleaks::CopyleaksFileOcrSubmissionModel - base64 - base64 must be of type String' end unless filename.instance_of?(String) raise 'Copyleaks::CopyleaksFileOcrSubmissionModel - filename - filename must be of type String' end unless properties.instance_of?(SubmissionProperties) raise 'Copyleaks::CopyleaksFileOcrSubmissionModel - properties - properties must be of type SubmissionProperties' end super(base64, filename, properties) @langCode = langCode end |
Instance Method Details
#as_json(*_args) ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'lib/copyleaks/models/submissions/file_ocr_submission_model.rb', line 48 def as_json(*_args) { langCode: @langCode, base64: @base64, filename: @filename, properties: @properties }.select { |_k, v| !v.nil? } end |
#to_json(*options) ⇒ Object
57 58 59 |
# File 'lib/copyleaks/models/submissions/file_ocr_submission_model.rb', line 57 def to_json(*) as_json(*).to_json(*) end |