Class: Dry::Logic::Rule::Key
Instance Attribute Summary
#name, #predicate
Class Method Summary
collapse
Instance Method Summary
collapse
#and, #curry, #initialize, #negation, #new, #or, #predicate_id, #then, #to_ary, #xor
Class Method Details
.new(name, predicate) ⇒ Object
4
5
6
|
# File 'lib/dry/logic/rule/key.rb', line 4
def self.new(name, predicate)
super(name, predicate.curry(name))
end
|
Instance Method Details
#call(input) ⇒ Object
12
13
14
|
# File 'lib/dry/logic/rule/key.rb', line 12
def call(input)
Logic.Result(input[name], predicate.(input), self)
end
|
#type ⇒ Object
8
9
10
|
# File 'lib/dry/logic/rule/key.rb', line 8
def type
:key
end
|