Sha256: ae7f13a57a225f06d6f64ffd74bcd3731ba2ef1e20fd705ba90fbe3ead907f4f

Contents?: true

Size: 679 Bytes

Versions: 3

Compression:

Stored size: 679 Bytes

Contents

module AQL
  class Node
    class Operator
      # Base class for unary operators
      class Unary < self
        include Concord.new(:target)

      private

        # Emit node
        #
        # @return [undefined]
        #
        # @api private
        #
        def emit(buffer)
          buffer.append(operator)
          target.visit(buffer)
        end

        # Unary negation operator
        class Negation < self
          SYMBOL = :'!'
        end

        # Unary plus operator
        class Plus < self
          SYMBOL = :+
        end

        # Unary minus operator
        class Minus < self
          SYMBOL = :-
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aql-0.0.3 lib/aql/node/operator/unary.rb
aql-0.0.2 lib/aql/node/operator/unary.rb
aql-0.0.1 lib/aql/node/operator/unary.rb