class Dry::Validation::Function

Abstract class for handling rule blocks

@see Rule @see Macro

@api private

Private Instance Methods

map_keywords(block) click to toggle source

Extract options for the block kwargs

@param [Proc] block Callable @return Hash

@api private

# File lib/dry/validation/function.rb, line 35
def map_keywords(block)
  block
    .parameters
    .select { |arg,| arg.equal?(:keyreq) }
    .to_h { [_2, BLOCK_OPTIONS_MAPPINGS[_2]] }
end