Class: Spectre::Closure
- Inherits:
-
Hash
- Object
- Hash
- Spectre::Closure
- Defined in:
- lib/spectre/base/closure.rb
Overview
Provides a Closure over several semantic actions to allow them to interact with each other and temporarily store data. The default Closure is a simple hash, but actually it can be an arbitrary object, as long as it provides the Hash methods []
and []=
and the attributes parser
and node
.
Instance Attribute Summary collapse
-
#node ⇒ Object
The Node this Closure belongs to.
-
#parser ⇒ Object
The Parser this Closure belongs to.
Instance Method Summary collapse
Instance Attribute Details
#node ⇒ Object
The Node this Closure belongs to.
39 40 41 |
# File 'lib/spectre/base/closure.rb', line 39 def node @node end |
#parser ⇒ Object
The Parser this Closure belongs to.
35 36 37 |
# File 'lib/spectre/base/closure.rb', line 35 def parser @parser end |
Instance Method Details
#parent ⇒ Object
41 42 43 |
# File 'lib/spectre/base/closure.rb', line 41 def parent @parser.parent.closure end |