Class: TestInterpreter

Inherits:
BlocklyInterpreter::Interpreter show all
Defined in:
lib/blockly_interpreter/blockly_interpreter_test_helper.rb

Defined Under Namespace

Classes: ExecutionContext

Instance Attribute Summary

Attributes inherited from BlocklyInterpreter::Interpreter

#debug_messages, #program

Instance Method Summary collapse

Methods inherited from BlocklyInterpreter::Interpreter

#add_debug_messages, #execute

Constructor Details

#initialize(program, variables = {}) ⇒ TestInterpreter

Returns a new instance of TestInterpreter.



68
69
70
71
# File 'lib/blockly_interpreter/blockly_interpreter_test_helper.rb', line 68

def initialize(program, variables = {})
  super(program)
  @variables = variables
end

Instance Method Details

#build_execution_contextObject



77
78
79
# File 'lib/blockly_interpreter/blockly_interpreter_test_helper.rb', line 77

def build_execution_context
  TestInterpreter::ExecutionContext.new(self, @variables)
end

#contentObject



73
74
75
# File 'lib/blockly_interpreter/blockly_interpreter_test_helper.rb', line 73

def content
  execute.content
end