Class: Papercraft::DeferNode

Inherits:
Object
  • Object
show all
Defined in:
lib/papercraft/compiler/nodes.rb

Overview

Represents a defer call

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#blockObject (readonly)

Returns the value of attribute block.



137
138
139
# File 'lib/papercraft/compiler/nodes.rb', line 137

def block
  @block
end

#call_nodeObject (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

#locationObject (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