Class: Dry::Logic::Evaluator::Set

Inherits:
Object
  • Object
show all
Defined in:
lib/dry/logic/evaluator.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(evaluators) ⇒ Set

Returns a new instance of Set.



19
20
21
# File 'lib/dry/logic/evaluator.rb', line 19

def initialize(evaluators)
  @evaluators = evaluators
end

Instance Attribute Details

#evaluatorsObject (readonly)

Returns the value of attribute evaluators.



13
14
15
# File 'lib/dry/logic/evaluator.rb', line 13

def evaluators
  @evaluators
end

Class Method Details

.new(paths) ⇒ Object



15
16
17
# File 'lib/dry/logic/evaluator.rb', line 15

def self.new(paths)
  super(paths.map { |path| Evaluator::Key.new(path) })
end

Instance Method Details

#call(input) ⇒ Object Also known as: []



23
24
25
# File 'lib/dry/logic/evaluator.rb', line 23

def call(input)
  evaluators.map { |evaluator| evaluator[input] }
end