Class: SportsManager::SolutionDrawer::CLI
- 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
-
#tournament_solution ⇒ Object
readonly
Returns the value of attribute tournament_solution.
Class Method Summary collapse
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(tournament_solution) ⇒ CLI
constructor
A new instance of CLI.
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_solution ⇒ Object (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
#draw ⇒ Object
26 27 28 |
# File 'lib/sports_manager/solution_drawer/cli.rb', line 26 def draw no_solution || draw_solutions end |