Class: View::Board
Instance Method Summary collapse
-
#initialize(board_presenter, table_klass) ⇒ Board
constructor
A new instance of Board.
- #render ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(board_presenter, table_klass) ⇒ Board
Returns a new instance of Board.
3 4 5 6 |
# File 'lib/tic_tac_toe/view/board.rb', line 3 def initialize(board_presenter, table_klass) @board_presenter = board_presenter @table_klass = table_klass end |
Instance Method Details
#render ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/tic_tac_toe/view/board.rb', line 8 def render tile_collection = @board_presenter.tile_collection headings = generate_headings(tile_collection.dimensions) rows = format_rows(tile_collection.rows) table = @table_klass.new(headings: headings, rows: rows, style: { all_separators: true }) display_msg(table) end |