Method: Kickflow::FormFieldDetail::EnumAttributeValidator#initialize
- Defined in:
- lib/kickflow/models/form_field_detail.rb
#initialize(datatype, allowable_values) ⇒ EnumAttributeValidator
Returns a new instance of EnumAttributeValidator.
100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/kickflow/models/form_field_detail.rb', line 100 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 |