Class: Dry::Logic::Result::Value

Inherits:
Dry::Logic::Result show all
Defined in:
lib/dry/logic/result/value.rb

Direct Known Subclasses

Named

Instance Attribute Summary

Attributes inherited from Dry::Logic::Result

#input, #response, #rule, #success

Instance Method Summary collapse

Methods inherited from Dry::Logic::Result

[], #[], #failure?, #initialize, #name, #negated, #success?

Constructor Details

This class inherits a constructor from Dry::Logic::Result

Instance Method Details

#to_astObject



4
5
6
7
8
9
10
# File 'lib/dry/logic/result/value.rb', line 4

def to_ast
  if response.respond_to?(:to_ast)
    response.to_ast
  else
    [:result, [rule.evaluate(input), rule.to_ast]]
  end
end