Class: Dry::Logic::Result::Set
- Inherits:
-
Dry::Logic::Result
- Object
- Dry::Logic::Result
- Dry::Logic::Result::Set
- Defined in:
- lib/dry/logic/result.rb
Instance Attribute Summary
Attributes inherited from Dry::Logic::Result
Instance Method Summary collapse
Methods inherited from Dry::Logic::Result
#>, #and, #call, #curry, #failure?, #initialize, #negated, #or, #xor
Constructor Details
This class inherits a constructor from Dry::Logic::Result
Instance Method Details
#success? ⇒ Boolean
17 18 19 |
# File 'lib/dry/logic/result.rb', line 17 def success? value.all?(&:success?) end |
#to_ary ⇒ Object
21 22 23 24 |
# File 'lib/dry/logic/result.rb', line 21 def to_ary indices = value.map { |v| v.failure? ? value.index(v) : nil }.compact [:input, [rule.name, input, value.values_at(*indices).map(&:to_ary)]] end |