Module: AdventOfCodeGenerator::Commands::BaseCommand
- Included in:
- GenerateDay, SolveDay
- Defined in:
- lib/advent_of_code_generator/commands/base_command.rb
Instance Method Summary collapse
- #day ⇒ Object
- #day_name ⇒ Object
- #input_file_path ⇒ Object
- #solution_file_path ⇒ Object
- #year ⇒ Object
Instance Method Details
#day ⇒ Object
6 7 8 |
# File 'lib/advent_of_code_generator/commands/base_command.rb', line 6 def day @day ||= [:day] end |
#day_name ⇒ Object
10 11 12 13 14 |
# File 'lib/advent_of_code_generator/commands/base_command.rb', line 10 def day_name return day.to_s if day > 9 "0#{day}" end |
#input_file_path ⇒ Object
20 21 22 |
# File 'lib/advent_of_code_generator/commands/base_command.rb', line 20 def input_file_path "#{day_name}/input.txt" end |
#solution_file_path ⇒ Object
16 17 18 |
# File 'lib/advent_of_code_generator/commands/base_command.rb', line 16 def solution_file_path "#{day_name}/day#{day_name}.rb" end |
#year ⇒ Object
24 25 26 |
# File 'lib/advent_of_code_generator/commands/base_command.rb', line 24 def year @year ||= [:year] end |