Module: Taro::Types::FieldValueValidation

Included in:
Field
Defined in:
lib/taro/types/field_value_validation.rb

Instance Method Summary collapse

Instance Method Details

#validated_value(value, for_input = true) ⇒ Object

Validate the value against the field properties. This method will raise a Taro::InputError or Taro::ResponseError if the value is not matching.



4
5
6
7
8
# File 'lib/taro/types/field_value_validation.rb', line 4

def validated_value(value, for_input = true)
  validate_null_and_ok?(value, for_input)
  validate_enum_inclusion(value, for_input)
  value
end