Sha256: 5cf90bf3023fdd05f9c6d195ce20c695950d65c5aba562bee5d62acd45a55128
Contents?: true
Size: 431 Bytes
Versions: 12
Compression:
Stored size: 431 Bytes
Contents
require 'dry-validation' ast = [ [ :and, [ [:key, [:age, [:predicate, [:key?, []]]]], [ :and, [ [:val, [:age, [:predicate, [:filled?, []]]]], [:val, [:age, [:predicate, [:gt?, [18]]]]] ] ] ] ] ] compiler = Dry::Validation::RuleCompiler.new(Dry::Validation::Predicates) rules = compiler.call(ast) puts rules.inspect puts rules.map(&:to_ary).inspect
Version data entries
12 entries across 12 versions & 1 rubygems