Class: SportsManager::SolutionDrawer::Mermaid::SolutionGantt
- Extended by:
- Forwardable
- Defined in:
- lib/sports_manager/solution_drawer/mermaid/solution_gantt.rb
Constant Summary collapse
- TIME_TEMPLATE =
'%d/%m %H:%M'- TIME_INTERVAL =
TODO: make it dynamic
'1h'
Instance Attribute Summary collapse
-
#solution ⇒ Object
readonly
Returns the value of attribute solution.
Class Method Summary collapse
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(solution) ⇒ SolutionGantt
constructor
A new instance of SolutionGantt.
- #sections ⇒ Object
Constructor Details
#initialize(solution) ⇒ SolutionGantt
Returns a new instance of SolutionGantt.
20 21 22 |
# File 'lib/sports_manager/solution_drawer/mermaid/solution_gantt.rb', line 20 def initialize(solution) @solution = solution end |
Instance Attribute Details
#solution ⇒ Object (readonly)
Returns the value of attribute solution.
12 13 14 |
# File 'lib/sports_manager/solution_drawer/mermaid/solution_gantt.rb', line 12 def solution @solution end |
Class Method Details
.draw(solution) ⇒ Object
16 17 18 |
# File 'lib/sports_manager/solution_drawer/mermaid/solution_gantt.rb', line 16 def self.draw(solution) new(solution).draw end |
Instance Method Details
#draw ⇒ Object
24 25 26 |
# File 'lib/sports_manager/solution_drawer/mermaid/solution_gantt.rb', line 24 def draw Gantt.draw(sections: sections) end |
#sections ⇒ Object
28 29 30 31 32 |
# File 'lib/sports_manager/solution_drawer/mermaid/solution_gantt.rb', line 28 def sections fixtures .group_by(&:court) .yield_self { |sections_fixtures| build_sections(sections_fixtures) } end |