Class: AocCli::Presenters::AttemptPresenter
- Inherits:
-
Object
- Object
- AocCli::Presenters::AttemptPresenter
- Defined in:
- lib/aoc_cli/presenters/attempt_presenter.rb
Instance Attribute Summary collapse
-
#attempt ⇒ Object
readonly
Returns the value of attribute attempt.
Instance Method Summary collapse
- #hint ⇒ Object
-
#initialize(attempt) ⇒ AttemptPresenter
constructor
A new instance of AttemptPresenter.
- #status ⇒ Object
Constructor Details
#initialize(attempt) ⇒ AttemptPresenter
Returns a new instance of AttemptPresenter.
6 7 8 |
# File 'lib/aoc_cli/presenters/attempt_presenter.rb', line 6 def initialize(attempt) @attempt = attempt end |
Instance Attribute Details
#attempt ⇒ Object (readonly)
Returns the value of attribute attempt.
4 5 6 |
# File 'lib/aoc_cli/presenters/attempt_presenter.rb', line 4 def attempt @attempt end |
Instance Method Details
#hint ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/aoc_cli/presenters/attempt_presenter.rb', line 20 def hint case attempt.hint when :too_low then "Too low" when :too_high then "Too high" else "-" end end |
#status ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/aoc_cli/presenters/attempt_presenter.rb', line 10 def status case attempt.status when :wrong_level then "Wrong level" when :rate_limited then "Rate limited" when :incorrect then "Incorrect" when :correct then "Correct" else raise end end |