Class: LogicTools::NodeValue
Overview
Represents a value node.
Instance Method Summary collapse
-
#==(node) ⇒ Object
Compares with
node. -
#eval ⇒ Object
Computes the value of the node.
-
#getVariablesRecurse ⇒ Object
Gets the variables, recursively, without postprocessing.
-
#to_s ⇒ Object
Converts to a string.
-
#to_sym ⇒ Object
Converts to a symbol.
Methods inherited from Node
#distribute, #each, #each_line, #each_maxterm, #each_minterm, #eql?, #flatten, #flatten_deep, #getVariables, #hash, #inspect, #op, #simplify, #size, #to_std_conjunctive, #to_std_disjunctive, #to_sum_product
Instance Method Details
#==(node) ⇒ Object
Compares with node.
277 278 279 280 |
# File 'lib/logic_tools/logictree.rb', line 277 def ==(node) # :nodoc: return false unless node.is_a?(NodeValue) return self.eval() == node.eval() end |
#eval ⇒ Object
Computes the value of the node.
283 284 285 |
# File 'lib/logic_tools/logictree.rb', line 283 def eval return @value end |
#getVariablesRecurse ⇒ Object
Gets the variables, recursively, without postprocessing.
Returns the variables into sets of arrays with possible doublon
272 273 274 |
# File 'lib/logic_tools/logictree.rb', line 272 def getVariablesRecurse() # :nodoc: return [ ] end |
#to_s ⇒ Object
Converts to a string.
293 294 295 |
# File 'lib/logic_tools/logictree.rb', line 293 def to_s # :nodoc: return @value.to_s end |
#to_sym ⇒ Object
Converts to a symbol.
288 289 290 |
# File 'lib/logic_tools/logictree.rb', line 288 def to_sym # :nodoc: return @sym end |