Class: AocCli::Components::AttemptsTable

Inherits:
Kangaru::Component
  • Object
show all
Defined in:
lib/aoc_cli/components/attempts_table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#puzzleObject (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

#headingsObject



14
15
16
# File 'lib/aoc_cli/components/attempts_table.rb', line 14

def headings
  %w[Answer Status Time Hint]
end

#rowsObject



18
19
20
# File 'lib/aoc_cli/components/attempts_table.rb', line 18

def rows
  [*level_one_rows, separator, *level_two_rows].compact
end

#titleObject



10
11
12
# File 'lib/aoc_cli/components/attempts_table.rb', line 10

def title
  "Advent of Code: #{puzzle.presenter.date}"
end