Class: Ruleby::Core::AtomNode
- Inherits:
-
ParentNode
- Object
- Printable
- Node
- ParentNode
- Ruleby::Core::AtomNode
- Defined in:
- lib/core/nodes.rb
Overview
This is a base class for all single input nodes that match facts based on some properties. It is essentially a wrapper for an Atom. These nodes make up the Alpha network.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#atom ⇒ Object
readonly
Returns the value of attribute atom.
Attributes inherited from ParentNode
Attributes inherited from Printable
Instance Method Summary collapse
- #==(node) ⇒ Object
-
#initialize(atom) ⇒ AtomNode
constructor
A new instance of AtomNode.
- #shareable?(node) ⇒ Boolean
- #to_s ⇒ Object
Methods inherited from ParentNode
#add_out_node, #assert, #forks?, #propagate_assert, #propagate_retract, #retract
Methods inherited from Node
Methods inherited from Printable
Constructor Details
#initialize(atom) ⇒ AtomNode
Returns a new instance of AtomNode.
330 331 332 333 |
# File 'lib/core/nodes.rb', line 330 def initialize(atom) super() @atom = atom end |
Instance Attribute Details
#atom ⇒ Object (readonly)
Returns the value of attribute atom.
329 330 331 |
# File 'lib/core/nodes.rb', line 329 def atom @atom end |
Instance Method Details
#==(node) ⇒ Object
335 336 337 |
# File 'lib/core/nodes.rb', line 335 def ==(node) return AtomNode === node && @atom == node.atom end |
#shareable?(node) ⇒ Boolean
339 340 341 |
# File 'lib/core/nodes.rb', line 339 def shareable?(node) return @atom.shareable?(node.atom) end |
#to_s ⇒ Object
343 344 345 |
# File 'lib/core/nodes.rb', line 343 def to_s super + " - #{@atom.method}" end |