Class: AocCli::Processors::EventInitialiser
- Inherits:
-
Core::Processor
- Object
- Core::Processor
- AocCli::Processors::EventInitialiser
- Defined in:
- lib/aoc_cli/processors/event_initialiser.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
- #run ⇒ Object
-
#validate ⇒ Object
TODO: use conditional validation once supported by Kangaru.
Methods inherited from Core::Processor
Instance Attribute Details
#dir ⇒ Object
Returns the value of attribute dir.
8 9 10 |
# File 'lib/aoc_cli/processors/event_initialiser.rb', line 8 def dir @dir end |
#year ⇒ Object
Returns the value of attribute year.
8 9 10 |
# File 'lib/aoc_cli/processors/event_initialiser.rb', line 8 def year @year end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/aoc_cli/processors/event_initialiser.rb', line 17 def run create_event!.tap do |event| initialise_stats!(event) make_event_directory! attach_event!(event) end end |
#validate ⇒ Object
TODO: use conditional validation once supported by Kangaru
11 12 13 14 15 |
# File 'lib/aoc_cli/processors/event_initialiser.rb', line 11 def validate super validate_event_not_already_initialised! if errors.empty? validate_event_dir_does_not_exist! if errors.empty? end |