Class: Operator

Inherits:
Object
  • Object
show all
Defined in:
lib/rast/rules/operator.rb

Overview

Operator Enum in Java. To be used only internally in RuleEvaluator class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: '', symbol: '', precedence: -1)) ⇒ Operator

Returns a new instance of Operator.



9
10
11
12
13
# File 'lib/rast/rules/operator.rb', line 9

def initialize(name: '', symbol: '', precedence: -1)
  @name = name
  @symbol = symbol
  @precedence = precedence
end

Instance Attribute Details

#nameObject (readonly)

Not(‘!’, Byte.MAX_VALUE), And(‘&’, (byte) 2), Or(‘|’, (byte) 1)



7
8
9
# File 'lib/rast/rules/operator.rb', line 7

def name
  @name
end

#precedenceObject (readonly)

Not(‘!’, Byte.MAX_VALUE), And(‘&’, (byte) 2), Or(‘|’, (byte) 1)



7
8
9
# File 'lib/rast/rules/operator.rb', line 7

def precedence
  @precedence
end

#symbolObject (readonly)

Not(‘!’, Byte.MAX_VALUE), And(‘&’, (byte) 2), Or(‘|’, (byte) 1)



7
8
9
# File 'lib/rast/rules/operator.rb', line 7

def symbol
  @symbol
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/rast/rules/operator.rb', line 15

def to_s
  @operator.to_s
end