Sha256: 1dc812560ec8227d7cf136b05cb53808134101beefa751771d2d1b17e68cd94b

Contents?: true

Size: 947 Bytes

Versions: 8

Compression:

Stored size: 947 Bytes

Contents

module Alf
  module Algebra
    module Classification

      # @return true if this is a relational operator, false otherwise
      def relational?
        ancestors.include?(Relational)
      end

      # @return true if this is an experimental operator, false otherwise
      def experimental?
        ancestors.include?(Experimental)
      end

      # @return true if this is a non relational operator, false otherwise
      def non_relational?
        ancestors.include?(NonRelational)
      end

      # @return true if this operator is a zero-ary operator, false otherwise
      def nullary?
        arity == 0
      end

      # @return true if this operator is an unary operator, false otherwise
      def unary?
        arity == 1
      end

      # @return true if this operator is a binary operator, false otherwise
      def binary?
        arity == 2
      end

    end # module Classification
  end # module Algebra
end # module Alf

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
alf-core-0.16.3 lib/alf/algebra/support/classification.rb
alf-core-0.16.2 lib/alf/algebra/support/classification.rb
alf-core-0.16.1 lib/alf/algebra/support/classification.rb
alf-core-0.16.0 lib/alf/algebra/support/classification.rb
alf-core-0.15.0 lib/alf/algebra/support/classification.rb
alf-core-0.14.0 lib/alf-algebra/alf/algebra/support/classification.rb
alf-core-0.13.1 lib/alf-algebra/alf/algebra/support/classification.rb
alf-core-0.13.0 lib/alf-algebra/alf/algebra/support/classification.rb