class EXEL::ASTNode

An abstract class that serves as the parent class of nodes in the AST

Attributes

children[R]
instruction[R]

Public Class Methods

new(instruction, children: []) click to toggle source
# File lib/exel/ast_node.rb, line 8
def initialize(instruction, children: [])
  @instruction = instruction
  @children = children
end

Public Instance Methods

add_child(node) click to toggle source
# File lib/exel/ast_node.rb, line 23
def add_child(node)
  @children << node
end
run(_context) click to toggle source
# File lib/exel/ast_node.rb, line 19
def run(_context)
  raise "#{self.class} does not implement #process"
end
start(context) click to toggle source
# File lib/exel/ast_node.rb, line 13
def start(context)
  run(context)
rescue EXEL::Error::JobTermination => e
  EXEL.logger.send(e.cmd, "JobTerminationError: #{e.message.chomp}")
end