Class: AocCli::Presenters::PuzzlePresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/aoc_cli/presenters/puzzle_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(puzzle) ⇒ PuzzlePresenter

Returns a new instance of PuzzlePresenter.



6
7
8
# File 'lib/aoc_cli/presenters/puzzle_presenter.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/presenters/puzzle_presenter.rb', line 4

def puzzle
  @puzzle
end

Instance Method Details

#dateObject



10
11
12
# File 'lib/aoc_cli/presenters/puzzle_presenter.rb', line 10

def date
  "#{puzzle.event.year}-12-#{formatted_day}"
end

#input_filenameObject



18
19
20
# File 'lib/aoc_cli/presenters/puzzle_presenter.rb', line 18

def input_filename
  "input"
end

#puzzle_filenameObject



14
15
16
# File 'lib/aoc_cli/presenters/puzzle_presenter.rb', line 14

def puzzle_filename
  "day_#{formatted_day}.md"
end