Class: AocCli::Attempt

Inherits:
Kangaru::Model
  • Object
show all
Defined in:
lib/aoc_cli/models/attempt.rb

Instance Method Summary collapse

Instance Method Details

#presenterObject



19
20
21
# File 'lib/aoc_cli/models/attempt.rb', line 19

def presenter
  @presenter ||= Presenters::AttemptPresenter.new(self)
end

#validateObject

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