Class: FluentValidation::Validators::NotEmptyValidatorHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent_validation/validators/not_empty_validator_handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(next_handler) ⇒ NotEmptyValidatorHandler

Returns a new instance of NotEmptyValidatorHandler.



4
5
6
# File 'lib/fluent_validation/validators/not_empty_validator_handler.rb', line 4

def initialize(next_handler)
  @next_handler = next_handler
end

Instance Method Details

#handle(object) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/fluent_validation/validators/not_empty_validator_handler.rb', line 8

def handle(object)
  if can_handle? object
    respond object
  elsif !@next_handler.nil?
    @next_handler.handle object
  else
    true
  end
end