Class: Ruleby::Core::FunctionNode
- Defined in:
- lib/core/nodes.rb
Overview
This node class is used conditions that are simply a function, which returns true or false.
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, #initialize, #modify, #propagate, #propagate_assert, #propagate_modify, #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(assertable) ⇒ Object
505 506 507 508 509 510 511 512 513 514 515 516 |
# File 'lib/core/nodes.rb', line 505 def assert(assertable) begin super if @atom.proc.call(assertable.fact.object, *@atom.arguments) rescue Exception => e @bucket.add_error Error.new(:proc_call, :error, { :object => fact.object.to_s, :function => true, :arguments => @atom.arguments, :message => e. }) end end |