Sha256: 77093623073da1bc63ea1457f7f3fe6862024ebc1cb3ff3caf040a97e87acf82
Contents?: true
Size: 587 Bytes
Versions: 6
Compression:
Stored size: 587 Bytes
Contents
# frozen_string_literal: true require "dry/logic/rule" module Dry module Logic class Rule::Predicate < Rule def self.specialize(arity, curried, base = Predicate) super end def type :predicate end def name predicate.name end def to_s if args.size > 0 "#{name}(#{args.map(&:inspect).join(", ")})" else name.to_s end end def ast(input = Undefined) [type, [name, args_with_names(input)]] end alias_method :to_ast, :ast end end end
Version data entries
6 entries across 6 versions & 2 rubygems