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.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Atom
#deftemplate, #method, #proc, #tag
Instance Method Summary collapse
-
#initialize(tag, method, deftemplate, value) ⇒ EqualsAtom
constructor
A new instance of EqualsAtom.
- #shareable?(atom) ⇒ Boolean
Methods inherited from PropertyAtom
Methods inherited from Atom
Constructor Details
#initialize(tag, method, deftemplate, value) ⇒ EqualsAtom
Returns a new instance of EqualsAtom.
67 68 69 70 |
# File 'lib/core/atoms.rb', line 67 def initialize(tag, method, deftemplate, value) super(tag,method,deftemplate) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
66 67 68 |
# File 'lib/core/atoms.rb', line 66 def value @value end |
Instance Method Details
#shareable?(atom) ⇒ Boolean
72 73 74 75 76 |
# File 'lib/core/atoms.rb', line 72 def shareable?(atom) return EqualsAtom === atom && @method == atom.method && @deftemplate == atom.deftemplate end |