Class: Reporter
- Inherits:
-
Object
- Object
- Reporter
- Defined in:
- lib/utils/prompts/reporter.rb
Overview
Simple Console Reporting or usage instructions
Instance Method Summary collapse
-
#initialize ⇒ Reporter
constructor
A new instance of Reporter.
- #quest_complete(quest) ⇒ Object
- #success(message) ⇒ Object
- #timed_success(message, seconds) ⇒ Object
- #welcome ⇒ Object
Constructor Details
#initialize ⇒ Reporter
Returns a new instance of Reporter.
8 9 10 11 12 13 |
# File 'lib/utils/prompts/reporter.rb', line 8 def initialize @pastel = Pastel.new @prompt = TTY::Prompt.new format = "[#{@pastel.yellow(':spinner')}] " + @pastel.yellow('jiraing...') @spinner = TTY::Spinner.new(format, success_mark: @pastel.green('+')) end |
Instance Method Details
#quest_complete(quest) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/utils/prompts/reporter.rb', line 30 def quest_complete(quest) Fig.new.('jirad HARD') sleep 3 system 'clear' success("Congratulations! You completed the #{quest} Quest!") Score.new.update_quests(quest) end |
#success(message) ⇒ Object
20 21 22 |
# File 'lib/utils/prompts/reporter.rb', line 20 def success() @spinner.success(@pastel.green()) end |
#timed_success(message, seconds) ⇒ Object
24 25 26 27 28 |
# File 'lib/utils/prompts/reporter.rb', line 24 def timed_success(, seconds) @spinner.auto_spin sleep seconds success("✅ #{}\n") end |