Class: Ruleby::Core::PropertyNode
- Defined in:
- lib/core/nodes.rb
Overview
This node class is used for matching properties of a fact.
Instance Attribute Summary
Attributes inherited from AtomNode
Attributes inherited from ParentNode
Attributes inherited from Printable
Instance Method Summary collapse
Methods inherited from AtomNode
#==, #initialize, #shareable?, #to_s
Methods inherited from ParentNode
#add_out_node, #forks?, #initialize, #propagate_assert, #propagate_retract, #retract
Methods inherited from Node
Methods inherited from Printable
Constructor Details
This class inherits a constructor from Ruleby::Core::AtomNode
Instance Method Details
#assert(fact) ⇒ Object
409 410 411 412 413 414 415 416 417 418 |
# File 'lib/core/nodes.rb', line 409 def assert(fact) begin val = fact.object.send(@atom.method) rescue NoMethodError => e # If the method does not exist, it is the same as if it evaluted to # false, and the network traverse stops return end super if @atom.proc.call(val) end |