Class: AocCli::Components::AttemptsTable
- Inherits:
-
Kangaru::Component
- Object
- Kangaru::Component
- AocCli::Components::AttemptsTable
- Defined in:
- lib/aoc_cli/components/attempts_table.rb
Instance Attribute Summary collapse
-
#puzzle ⇒ Object
readonly
Returns the value of attribute puzzle.
Instance Method Summary collapse
- #headings ⇒ Object
-
#initialize(puzzle:) ⇒ AttemptsTable
constructor
A new instance of AttemptsTable.
- #rows ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(puzzle:) ⇒ AttemptsTable
Returns a new instance of AttemptsTable.
6 7 8 |
# File 'lib/aoc_cli/components/attempts_table.rb', line 6 def initialize(puzzle:) @puzzle = puzzle end |
Instance Attribute Details
#puzzle ⇒ Object (readonly)
Returns the value of attribute puzzle.
4 5 6 |
# File 'lib/aoc_cli/components/attempts_table.rb', line 4 def puzzle @puzzle end |
Instance Method Details
#headings ⇒ Object
14 15 16 |
# File 'lib/aoc_cli/components/attempts_table.rb', line 14 def headings %w[Answer Status Time Hint] end |
#rows ⇒ Object
18 19 20 |
# File 'lib/aoc_cli/components/attempts_table.rb', line 18 def rows [*level_one_rows, separator, *level_two_rows].compact end |
#title ⇒ Object
10 11 12 |
# File 'lib/aoc_cli/components/attempts_table.rb', line 10 def title "Advent of Code: #{puzzle.presenter.date}" end |