Class: Dry::Validation::Rule::Key
Instance Attribute Summary
#name, #predicate
Class Method Summary
collapse
Instance Method Summary
collapse
#and, #curry, #initialize, #or, #to_ary
Class Method Details
.new(name, predicate) ⇒ Object
9
10
11
|
# File 'lib/dry/validation/rule.rb', line 9
def self.new(name, predicate)
super(name, predicate.curry(name))
end
|
Instance Method Details
#call(input) ⇒ Object
17
18
19
|
# File 'lib/dry/validation/rule.rb', line 17
def call(input)
Validation.Result(input[name], predicate.(input), self)
end
|
#type ⇒ Object
13
14
15
|
# File 'lib/dry/validation/rule.rb', line 13
def type
:key
end
|