Class: AocCli::Processors::SolutionPoster
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- AocCli::Processors::SolutionPoster
- Defined in:
- lib/aoc_cli/processors/solution_poster.rb
Instance Attribute Summary collapse
-
#answer ⇒ Object
Returns the value of attribute answer.
-
#puzzle ⇒ Object
Returns the value of attribute puzzle.
Instance Method Summary collapse
- #run ⇒ Object
-
#validate ⇒ Object
TODO: replace with conditional validation.
Methods inherited from Core::Processor
Instance Attribute Details
#answer ⇒ Object
Returns the value of attribute answer.
4 5 6 |
# File 'lib/aoc_cli/processors/solution_poster.rb', line 4 def answer @answer end |
#puzzle ⇒ Object
Returns the value of attribute puzzle.
4 5 6 |
# File 'lib/aoc_cli/processors/solution_poster.rb', line 4 def puzzle @puzzle end |
Instance Method Details
#run ⇒ Object
18 19 20 21 22 |
# File 'lib/aoc_cli/processors/solution_poster.rb', line 18 def run create_attempt!(post_solution!).tap do |attempt| advance_puzzle! if attempt.correct? end end |
#validate ⇒ Object
TODO: replace with conditional validation
11 12 13 14 15 16 |
# File 'lib/aoc_cli/processors/solution_poster.rb', line 11 def validate super validate_puzzle_location_set! if errors.empty? validate_stats_associated! if errors.empty? validate_puzzle_not_complete! if errors.empty? end |