Class: Stones::ExecutionContext

Inherits:
Object
  • Object
show all
Defined in:
lib/stones/execution_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#boardObject

Returns the value of attribute board.



3
4
5
# File 'lib/stones/execution_context.rb', line 3

def board
  @board
end

Instance Method Details

#run(program_class) ⇒ Object



5
6
7
8
9
# File 'lib/stones/execution_context.rb', line 5

def run(program_class)
  program = program_class.new
  program.board = board
  program.main
end