Class: AocCli::Processors::StatsInitialiser
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- AocCli::Processors::StatsInitialiser
- Defined in:
- lib/aoc_cli/processors/stats_initialiser.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
Returns the value of attribute event.
Instance Method Summary collapse
Methods inherited from Core::Processor
Instance Attribute Details
#event ⇒ Object
Returns the value of attribute event.
4 5 6 |
# File 'lib/aoc_cli/processors/stats_initialiser.rb', line 4 def event @event end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 |
# File 'lib/aoc_cli/processors/stats_initialiser.rb', line 13 def run stats = BLANK_STATS.merge(fetch_stats!) Stats.create(event:, **stats) end |
#validate ⇒ Object
8 9 10 11 |
# File 'lib/aoc_cli/processors/stats_initialiser.rb', line 8 def validate super validate_stats_do_not_exist! if errors.empty? end |