class FluentValidation::Validators::NotEmptyValidatorHandler

Public Class Methods

new(next_handler) click to toggle source
# File lib/fluent_validation/validators/not_empty_validator_handler.rb, line 4
def initialize(next_handler)
  @next_handler = next_handler
end

Public Instance Methods

handle(object) click to toggle source
# 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

Private Instance Methods

can_handle?(object) click to toggle source
# File lib/fluent_validation/validators/not_empty_validator_handler.rb, line 19
def can_handle?(object)
  raise NotImplementedError.new 'can_handle?'
end
respond(object) click to toggle source
# File lib/fluent_validation/validators/not_empty_validator_handler.rb, line 23
def respond(object)
  raise NotImplementedError.new 'respond'
end