Class: AocCli::Processors::PuzzleInitialiser
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- AocCli::Processors::PuzzleInitialiser
- Defined in:
- lib/aoc_cli/processors/puzzle_initialiser.rb
Instance Attribute Summary collapse
-
#day ⇒ Object
Returns the value of attribute day.
-
#event ⇒ Object
Returns the value of attribute event.
Instance Method Summary collapse
Methods inherited from Core::Processor
Instance Attribute Details
#day ⇒ Object
Returns the value of attribute day.
4 5 6 |
# File 'lib/aoc_cli/processors/puzzle_initialiser.rb', line 4 def day @day end |
#event ⇒ Object
Returns the value of attribute event.
4 5 6 |
# File 'lib/aoc_cli/processors/puzzle_initialiser.rb', line 4 def event @event end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/aoc_cli/processors/puzzle_initialiser.rb', line 17 def run create_or_update_puzzle!(fetch_content!, fetch_input!).tap do |puzzle| sync_puzzle_progress!(puzzle) attach_puzzle_dir!(puzzle).tap do |location| write_puzzle_files!(puzzle, location) end end end |
#validate ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/aoc_cli/processors/puzzle_initialiser.rb', line 9 def validate super validate_event_stats_set! if errors.empty? validate_event_location_set! if errors.empty? validate_event_dir_exists! if errors.empty? validate_puzzle_dir_does_not_exist! if errors.empty? end |