class LogicTools::NodeVar
Represents a variable node.
Attributes
variable[R]
The variable held by the node.
Public Class Methods
new(name)
click to toggle source
Creates a node with variable name
.
# File lib/logic_tools/logictree.rb, line 390 def initialize(name) @variable = Variable.get(name) # @sym = @variable.to_s.to_sym @sym = nil end
Public Instance Methods
eval()
click to toggle source
Computes the value of the node.
# File lib/logic_tools/logictree.rb, line 410 def eval() return @variable.value end
op()
click to toggle source
Gets the operator.
Default: nil
(none).
# File lib/logic_tools/logictree.rb, line 399 def op :variable end