Sha256: 557bfcedd59a092e765c698bf747b2ce2550a06fa2fd98b16fe47b11bd890eda

Contents?: true

Size: 313 Bytes

Versions: 5

Compression:

Stored size: 313 Bytes

Contents

module Dry
  module Logic
    class Result::Named < Result::Value
      def name
        rule.name
      end

      def to_ast
        if response.respond_to?(:to_ast) && !response.is_a?(Result)
          response.to_ast
        else
          [:input, [rule.name, super]]
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dry-logic-0.3.0 lib/dry/logic/result/named.rb
dry-logic-0.2.3 lib/dry/logic/result/named.rb
dry-logic-0.2.2 lib/dry/logic/result/named.rb
dry-logic-0.2.1 lib/dry/logic/result/named.rb
dry-logic-0.2.0 lib/dry/logic/result/named.rb