Class: Ruleby::Core::EqualsAtom
- Inherits:
-
PropertyAtom
- Object
- Atom
- PropertyAtom
- Ruleby::Core::EqualsAtom
- Defined in:
- lib/core/atoms.rb
Overview
This kind of atom is used to match just a single, hard coded value.
For example:
a.name == 'John'
So there are no references to other atoms.
Constant Summary collapse
- EQUAL_PROC =
lambda {|x, y| x == y}
Instance Attribute Summary
Attributes inherited from PropertyAtom
Attributes inherited from Atom
Instance Method Summary collapse
-
#initialize(tag, slot, template, value) ⇒ EqualsAtom
constructor
A new instance of EqualsAtom.
- #shareable?(atom) ⇒ Boolean
Methods inherited from PropertyAtom
Methods inherited from Atom
Constructor Details
#initialize(tag, slot, template, value) ⇒ EqualsAtom
Returns a new instance of EqualsAtom.
92 93 94 |
# File 'lib/core/atoms.rb', line 92 def initialize(tag, slot, template, value) super(tag,slot,template, value, EQUAL_PROC) end |
Instance Method Details
#shareable?(atom) ⇒ Boolean
96 97 98 99 100 |
# File 'lib/core/atoms.rb', line 96 def shareable?(atom) EqualsAtom === atom && @slot == atom.slot && @template == atom.template end |