Module: Alf::Algebra::Classification
- Defined in:
- lib/alf-algebra/alf/algebra/support/classification.rb
Instance Method Summary collapse
-
#binary? ⇒ Boolean
True if this operator is a binary operator, false otherwise.
-
#experimental? ⇒ Boolean
True if this is an experimental operator, false otherwise.
-
#non_relational? ⇒ Boolean
True if this is a non relational operator, false otherwise.
-
#nullary? ⇒ Boolean
True if this operator is a zero-ary operator, false otherwise.
-
#relational? ⇒ Boolean
True if this is a relational operator, false otherwise.
-
#unary? ⇒ Boolean
True if this operator is an unary operator, false otherwise.
Instance Method Details
#binary? ⇒ Boolean
Returns true if this operator is a binary operator, false otherwise.
31 32 33 |
# File 'lib/alf-algebra/alf/algebra/support/classification.rb', line 31 def binary? arity == 2 end |
#experimental? ⇒ Boolean
Returns true if this is an experimental operator, false otherwise.
11 12 13 |
# File 'lib/alf-algebra/alf/algebra/support/classification.rb', line 11 def experimental? ancestors.include?(Experimental) end |
#non_relational? ⇒ Boolean
Returns true if this is a non relational operator, false otherwise.
16 17 18 |
# File 'lib/alf-algebra/alf/algebra/support/classification.rb', line 16 def non_relational? ancestors.include?(NonRelational) end |
#nullary? ⇒ Boolean
Returns true if this operator is a zero-ary operator, false otherwise.
21 22 23 |
# File 'lib/alf-algebra/alf/algebra/support/classification.rb', line 21 def nullary? arity == 0 end |
#relational? ⇒ Boolean
Returns true if this is a relational operator, false otherwise.
6 7 8 |
# File 'lib/alf-algebra/alf/algebra/support/classification.rb', line 6 def relational? ancestors.include?(Relational) end |
#unary? ⇒ Boolean
Returns true if this operator is an unary operator, false otherwise.
26 27 28 |
# File 'lib/alf-algebra/alf/algebra/support/classification.rb', line 26 def unary? arity == 1 end |