Class: Attestor::Validations::Delegator Private

Inherits:
Validator
  • Object
show all
Defined in:
lib/attestor/validations/delegator.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Describe a validator that delegates validation to instance method or block

The follower not only calls an instance method (block) as validator does, but calls #validate method of the result.

Examples:

follower = Validator.new(:foo, only: :baz) { FooPolicy.new(foo) }

Instance Method Summary collapse

Methods inherited from Validator

==, initialize, new, used_in_context?, validate

Instance Method Details

#validate(_) ⇒ undefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Validates an object by delegation

Parameters:

  • object (Object)

Returns:

  • (undefined)

Raises:



25
26
27
# File 'lib/attestor/validations/delegator.rb', line 25

def validate(_)
  super.validate
end