Class: Rosebud::Validations::TypeValidator

Inherits:
Rosebud::Validator show all
Defined in:
lib/rosebud/validations/type_validator.rb

Instance Method Summary collapse

Methods inherited from Rosebud::Validator

#validate!

Instance Method Details

#validate_param(name, value, type) ⇒ Object



4
5
6
7
# File 'lib/rosebud/validations/type_validator.rb', line 4

def validate_param(name, value, type)
  coerced_value = coerce_value(type, value)
  error!(:type, param: name) unless valid_type?(type, coerced_value)
end