Method: Hubspot::Crm::Associations::ErrorCategory::EnumAttributeValidator#initialize

Defined in:
lib/hubspot/codegen/crm/associations/models/error_category.rb

#initialize(datatype, allowable_values) ⇒ EnumAttributeValidator

Returns a new instance of EnumAttributeValidator.


27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/hubspot/codegen/crm/associations/models/error_category.rb', line 27

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