Class: Papercraft::DeferNode
- Inherits:
-
Object
- Object
- Papercraft::DeferNode
- Defined in:
- lib/papercraft/compiler/nodes.rb
Overview
Represents a defer call
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#call_node ⇒ Object
readonly
Returns the value of attribute call_node.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(call_node, translator) ⇒ DeferNode
constructor
A new instance of DeferNode.
Constructor Details
#initialize(call_node, translator) ⇒ DeferNode
Returns a new instance of DeferNode.
139 140 141 142 143 |
# File 'lib/papercraft/compiler/nodes.rb', line 139 def initialize(call_node, translator) @call_node = call_node @location = call_node.location @block = call_node.block && translator.visit(call_node.block) end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
137 138 139 |
# File 'lib/papercraft/compiler/nodes.rb', line 137 def block @block end |
#call_node ⇒ Object (readonly)
Returns the value of attribute call_node.
137 138 139 |
# File 'lib/papercraft/compiler/nodes.rb', line 137 def call_node @call_node end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
137 138 139 |
# File 'lib/papercraft/compiler/nodes.rb', line 137 def location @location end |
Instance Method Details
#accept(visitor) ⇒ Object
145 146 147 |
# File 'lib/papercraft/compiler/nodes.rb', line 145 def accept(visitor) visitor.visit_defer_node(self) end |