Method: Highway::Steps::Types::Any#validate

Defined in:
lib/highway/steps/types/any.rb

#validate(value) ⇒ Boolean

Validate the typechecked value against a custom validation block.

This method returns ‘true` if value is valid or `false` if value is invalid.

Parameters:

  • value (Object)

    A value.

Returns:

  • (Boolean)
[View source]

43
44
45
46
# File 'lib/highway/steps/types/any.rb', line 43

def validate(value)
  return true if @validate == nil
  @validate.call(value)
end