Class: LogaltyCertificateIssuanceApiCerty::OcrValidationItem
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- LogaltyCertificateIssuanceApiCerty::OcrValidationItem
- Defined in:
- lib/logalty_certificate_issuance_api_certy/models/ocr_validation_item.rb
Overview
OcrValidationItem Model.
Instance Attribute Summary collapse
-
#blocker ⇒ TrueClass | FalseClass
Whether a failing result for this test blocks the issuance process.
-
#code ⇒ String
Validation test identifier (e.g. ‘TEST_FACE_RECOGNITION_RATIO`).
-
#condition ⇒ String
Threshold condition applied.
-
#result ⇒ String
Validation outcome (e.g. ‘OK`).
-
#value ⇒ Float
Threshold value used for the validation.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(code: SKIP, blocker: SKIP, condition: SKIP, result: SKIP, value: SKIP, additional_properties: nil) ⇒ OcrValidationItem
constructor
A new instance of OcrValidationItem.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(code: SKIP, blocker: SKIP, condition: SKIP, result: SKIP, value: SKIP, additional_properties: nil) ⇒ OcrValidationItem
Returns a new instance of OcrValidationItem.
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/logalty_certificate_issuance_api_certy/models/ocr_validation_item.rb', line 59 def initialize(code: SKIP, blocker: SKIP, condition: SKIP, result: SKIP, value: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @code = code unless code == SKIP @blocker = blocker unless blocker == SKIP @condition = condition unless condition == SKIP @result = result unless result == SKIP @value = value unless value == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#blocker ⇒ TrueClass | FalseClass
Whether a failing result for this test blocks the issuance process.
18 19 20 |
# File 'lib/logalty_certificate_issuance_api_certy/models/ocr_validation_item.rb', line 18 def blocker @blocker end |
#code ⇒ String
Validation test identifier (e.g. ‘TEST_FACE_RECOGNITION_RATIO`).
14 15 16 |
# File 'lib/logalty_certificate_issuance_api_certy/models/ocr_validation_item.rb', line 14 def code @code end |
#condition ⇒ String
Threshold condition applied.
22 23 24 |
# File 'lib/logalty_certificate_issuance_api_certy/models/ocr_validation_item.rb', line 22 def condition @condition end |
#result ⇒ String
Validation outcome (e.g. ‘OK`).
26 27 28 |
# File 'lib/logalty_certificate_issuance_api_certy/models/ocr_validation_item.rb', line 26 def result @result end |
#value ⇒ Float
Threshold value used for the validation.
30 31 32 |
# File 'lib/logalty_certificate_issuance_api_certy/models/ocr_validation_item.rb', line 30 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/logalty_certificate_issuance_api_certy/models/ocr_validation_item.rb', line 73 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. code = hash.key?('code') ? hash['code'] : SKIP blocker = hash.key?('blocker') ? hash['blocker'] : SKIP condition = hash.key?('condition') ? hash['condition'] : SKIP result = hash.key?('result') ? hash['result'] : SKIP value = hash.key?('value') ? hash['value'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. OcrValidationItem.new(code: code, blocker: blocker, condition: condition, result: result, value: value, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/logalty_certificate_issuance_api_certy/models/ocr_validation_item.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['code'] = 'code' @_hash['blocker'] = 'blocker' @_hash['condition'] = 'condition' @_hash['result'] = 'result' @_hash['value'] = 'value' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 |
# File 'lib/logalty_certificate_issuance_api_certy/models/ocr_validation_item.rb', line 55 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 52 |
# File 'lib/logalty_certificate_issuance_api_certy/models/ocr_validation_item.rb', line 44 def self.optionals %w[ code blocker condition result value ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
107 108 109 110 111 112 |
# File 'lib/logalty_certificate_issuance_api_certy/models/ocr_validation_item.rb', line 107 def inspect class_name = self.class.name.split('::').last "<#{class_name} code: #{@code.inspect}, blocker: #{@blocker.inspect}, condition:"\ " #{@condition.inspect}, result: #{@result.inspect}, value: #{@value.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
100 101 102 103 104 |
# File 'lib/logalty_certificate_issuance_api_certy/models/ocr_validation_item.rb', line 100 def to_s class_name = self.class.name.split('::').last "<#{class_name} code: #{@code}, blocker: #{@blocker}, condition: #{@condition}, result:"\ " #{@result}, value: #{@value}, additional_properties: #{@additional_properties}>" end |