Class: Ruleby::Core::PropertyAtom
Overview
This kind of atom is used to match a simple condition.
For example:
a.person{ |p| p.is_a? Person }
So there are no references to other atoms.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Atom
Instance Method Summary collapse
- #==(atom) ⇒ Object
-
#initialize(tag, slot, template, value, block) ⇒ PropertyAtom
constructor
A new instance of PropertyAtom.
- #shareable?(atom) ⇒ Boolean
Methods inherited from Atom
Constructor Details
#initialize(tag, slot, template, value, block) ⇒ PropertyAtom
Returns a new instance of PropertyAtom.
41 42 43 44 |
# File 'lib/core/atoms.rb', line 41 def initialize(tag, slot, template, value, block) super(tag,slot,template, block) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
39 40 41 |
# File 'lib/core/atoms.rb', line 39 def value @value end |
Instance Method Details
#==(atom) ⇒ Object
46 47 48 |
# File 'lib/core/atoms.rb', line 46 def ==(atom) shareable?(atom) && @tag == atom.tag end |
#shareable?(atom) ⇒ Boolean
50 51 52 53 54 55 56 |
# File 'lib/core/atoms.rb', line 50 def shareable?(atom) PropertyAtom === atom && @slot == atom.slot && @template == atom.template && @proc == atom.proc && @value == atom.value end |