class Gobstones::Runner::ProgramExecutionContext
Attributes
head[R]
Public Class Methods
for(program)
click to toggle source
# File lib/gobstones/runner/execution_context.rb, line 46 def self.for(program) new(program) end
new(program)
click to toggle source
Calls superclass method
Gobstones::Runner::ExecutionContext::new
# File lib/gobstones/runner/execution_context.rb, line 50 def initialize(program) super() @head = Head.new @program = program end
Public Instance Methods
board()
click to toggle source
# File lib/gobstones/runner/execution_context.rb, line 66 def board head.board end
definition_named(name, found_block, not_found_block)
click to toggle source
# File lib/gobstones/runner/execution_context.rb, line 56 def definition_named(name, found_block, not_found_block) if_none = proc { return not_found_block.call } found_definition = @program.definitions.detect(if_none) { |definition| definition.named?(name) } found_block.call(found_definition) end
program_context()
click to toggle source
# File lib/gobstones/runner/execution_context.rb, line 62 def program_context self end