Sha256: 174ca80ee5f48cd808aac4d6fb53f286b6af4aa49c20a338134ceb9c8aa86723
Contents?: true
Size: 520 Bytes
Versions: 5
Compression:
Stored size: 520 Bytes
Contents
# frozen_string_literal: true require 'dry/logic/operations/abstract' module Dry module Logic module Operations class Binary < Abstract attr_reader :left attr_reader :right def initialize(*rules, **options) super @left, @right = rules end def ast(input = Undefined) [type, [left.ast(input), right.ast(input)]] end def to_s "#{left} #{operator.to_s.upcase} #{right}" end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems