Class: Ruleby::Core::Node
Overview
Base Node class used by all nodes in the network that do some kind of matching.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Printable
Instance Method Summary collapse
-
#resolve(mr1, mr2) ⇒ Object
This method determines if all common tags have equal values.
Methods inherited from Printable
Constructor Details
This class inherits a constructor from Ruleby::Core::Printable
Instance Method Details
#resolve(mr1, mr2) ⇒ Object
This method determines if all common tags have equal values. If any values are not equal then the method returns false.
269 270 271 272 273 274 275 276 277 278 |
# File 'lib/core/nodes.rb', line 269 def resolve(mr1, mr2) mr1.variables.each_key do |t1| mr2.variables.each_key do |t2| if t2 == t1 && mr1.fact_hash[t1] != mr2.fact_hash[t2] return false end end end return true end |