Class: Ruleby::Core::InheritsNode

Inherits:
TypeNode show all
Defined in:
lib/core/nodes.rb

Overview

This class is used for the same purpose as the TypeNode, but it matches if the fact’s inheritance chain includes the specified class.

Instance Attribute Summary

Attributes inherited from AtomNode

#atom

Attributes inherited from ParentNode

#child_nodes

Attributes inherited from Printable

#parent_nodes

Instance Method Summary collapse

Methods inherited from TypeNode

#hash_by, #propagate, #retract

Methods inherited from HashedNode

#add_out_node, #initialize, #retract

Methods inherited from AtomNode

#==, #initialize, #shareable?, #to_s

Methods inherited from ParentNode

#add_out_node, #initialize, #modify, #propagate, #propagate_assert, #propagate_modify, #propagate_retract, #retract

Methods inherited from Node

#initialize, #resolve

Methods inherited from Printable

#initialize, #print

Constructor Details

This class inherits a constructor from Ruleby::Core::HashedNode

Instance Method Details

#assert(fact) ⇒ Object



456
457
458
459
460
# File 'lib/core/nodes.rb', line 456

def assert(fact)
  @values.each do |clazz,nodes| 
    propagate_assert fact, nodes if clazz === fact.object
  end
end