Class: Dry::Validation::PredicateRegistry::Unbound
- Inherits:
-
Dry::Validation::PredicateRegistry
- Object
- Dry::Validation::PredicateRegistry
- Dry::Validation::PredicateRegistry::Unbound
- Defined in:
- lib/dry/validation/predicate_registry.rb
Instance Attribute Summary
Attributes inherited from Dry::Validation::PredicateRegistry
Instance Method Summary collapse
Methods inherited from Dry::Validation::PredicateRegistry
[], #[], #ensure_valid_predicate, #initialize, #key?, #new
Constructor Details
This class inherits a constructor from Dry::Validation::PredicateRegistry
Instance Method Details
#bind(schema) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/dry/validation/predicate_registry.rb', line 18 def bind(schema) bound_predicates = predicates.each_with_object({}) do |(n, p), res| res[n] = p.bind(schema) end Bound.new(external, bound_predicates, schema) end |
#update(other) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/dry/validation/predicate_registry.rb', line 25 def update(other) unbound_predicates = other.each_with_object({}) { |(n, p), res| res[n] = Logic::Predicate.new(n, fn: p) } predicates.update(unbound_predicates) self end |