Method: DatadogAPIClient::EnumAttributeValidator#initialize

Defined in:
lib/datadog_api_client/models.rb

#initialize(datatype, allowable_values) ⇒ EnumAttributeValidator

Returns a new instance of EnumAttributeValidator.



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/datadog_api_client/models.rb', line 48

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