Class: Papercraft::BlockInvocationNode

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(call_node, translator) ⇒ BlockInvocationNode

Returns a new instance of BlockInvocationNode.



191
192
193
194
195
196
# File 'lib/papercraft/compiler/nodes.rb', line 191

def initialize(call_node, translator)
  @call_node = call_node
  @tag = call_node.name
  @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.



189
190
191
# File 'lib/papercraft/compiler/nodes.rb', line 189

def block
  @block
end

#call_nodeObject (readonly)

Returns the value of attribute call_node.



189
190
191
# File 'lib/papercraft/compiler/nodes.rb', line 189

def call_node
  @call_node
end

#locationObject (readonly)

Returns the value of attribute location.



189
190
191
# File 'lib/papercraft/compiler/nodes.rb', line 189

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



198
199
200
# File 'lib/papercraft/compiler/nodes.rb', line 198

def accept(visitor)
  visitor.visit_block_invocation_node(self)
end