Class: SportsManager::SolutionDrawer::CLI

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/sports_manager/solution_drawer/cli.rb,
lib/sports_manager/solution_drawer/cli/table.rb,
lib/sports_manager/solution_drawer/cli/solution_table.rb

Overview

Public: Outputs the tournament’s timetable solutions to stdout TODO: allow to pass which stdout will be used. puts|Logger|other

Defined Under Namespace

Classes: SolutionTable, Table

Constant Summary collapse

NO_SOLUTION =
'No solution found'
START_NUMBER =
1

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tournament_solution) ⇒ CLI



22
23
24
# File 'lib/sports_manager/solution_drawer/cli.rb', line 22

def initialize(tournament_solution)
  @tournament_solution = tournament_solution
end

Instance Attribute Details

#tournament_solutionObject (readonly)

Returns the value of attribute tournament_solution.



10
11
12
# File 'lib/sports_manager/solution_drawer/cli.rb', line 10

def tournament_solution
  @tournament_solution
end

Class Method Details

.draw(tournament_solution) ⇒ Object



18
19
20
# File 'lib/sports_manager/solution_drawer/cli.rb', line 18

def self.draw(tournament_solution)
  new(tournament_solution).draw
end

Instance Method Details

#drawObject



26
27
28
# File 'lib/sports_manager/solution_drawer/cli.rb', line 26

def draw
  no_solution || draw_solutions
end