Class: AocCli::Attempt
- Inherits:
-
Kangaru::Model
- Object
- Kangaru::Model
- AocCli::Attempt
- Defined in:
- lib/aoc_cli/models/attempt.rb
Instance Method Summary collapse
- #presenter ⇒ Object
-
#validate ⇒ Object
TODO: move to a conditional validation when supported by Kangaru.
Instance Method Details
#presenter ⇒ Object
19 20 21 |
# File 'lib/aoc_cli/models/attempt.rb', line 19 def presenter @presenter ||= Presenters::AttemptPresenter.new(self) end |
#validate ⇒ Object
TODO: move to a conditional validation when supported by Kangaru
24 25 26 27 28 29 30 |
# File 'lib/aoc_cli/models/attempt.rb', line 24 def validate super validate_hint_not_set! unless incorrect? validate_hint! if incorrect? validate_wait_time_not_set! if correct? || wrong_level? validate_wait_time_integer! if incorrect? || rate_limited? end |