module

Marten::Core::Validation

Provides validation to objects.

Instance methods

errors

Returns the error set containing the errors generated during a validation.

Source
invalid?(context : Nil | String | Symbol = nil)

Returns a boolean indicating whether the object is invalid.

An optional context can be specified using the context argument. When this option is used, additional validation rules that explicitly require a specific context might run.

Source
valid?(context : Nil | String | Symbol = nil)

Returns a boolean indicating whether the object is valid.

An optional context can be specified using the context argument. When this option is used, additional validation rules that explicitly require a specific context might run.

Source
validate

Allows to run custom validations for the considered object.

By default this method is empty and does nothing. It should be overridden in the specific class at hand in order to implement custom validation logics.

Source

Macros

validate(*names)

Registers validation methods.

Source

Nested types