Class: Dry::Logic::Evaluator::Set
- Inherits:
-
Object
- Object
- Dry::Logic::Evaluator::Set
- Defined in:
- lib/dry/logic/evaluator.rb
Instance Attribute Summary collapse
-
#evaluators ⇒ Object
readonly
Returns the value of attribute evaluators.
Class Method Summary collapse
Instance Method Summary collapse
- #call(input) ⇒ Object (also: #[])
-
#initialize(evaluators) ⇒ Set
constructor
A new instance of Set.
Constructor Details
#initialize(evaluators) ⇒ Set
Returns a new instance of Set.
17 18 19 |
# File 'lib/dry/logic/evaluator.rb', line 17 def initialize(evaluators) @evaluators = evaluators end |
Instance Attribute Details
#evaluators ⇒ Object (readonly)
Returns the value of attribute evaluators.
11 12 13 |
# File 'lib/dry/logic/evaluator.rb', line 11 def evaluators @evaluators end |
Class Method Details
.new(paths) ⇒ Object
13 14 15 |
# File 'lib/dry/logic/evaluator.rb', line 13 def self.new(paths) super(paths.map { |path| Evaluator::Key.new(path) }) end |
Instance Method Details
#call(input) ⇒ Object Also known as: []
21 22 23 |
# File 'lib/dry/logic/evaluator.rb', line 21 def call(input) evaluators.map { |evaluator| evaluator[input] } end |