Method: Onfido::ExtractionExtractedData::EnumAttributeValidator#initialize

Defined in:
lib/onfido/models/extraction_extracted_data.rb

#initialize(datatype, allowable_values) ⇒ EnumAttributeValidator

Returns a new instance of EnumAttributeValidator.



103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/onfido/models/extraction_extracted_data.rb', line 103

def initialize(datatype, allowable_values)
  @allowable_values = allowable_values.map do |value|
    case datatype.to_s
    when /Integer/i
      value.to_i
    when /Float/i
      value.to_f
    else
      value
    end
  end
end