Class: Ruby::Pomodoro::Progressbar
- Inherits:
-
Object
- Object
- Ruby::Pomodoro::Progressbar
- Defined in:
- lib/ruby/pomodoro/progressbar.rb
Instance Method Summary collapse
- #increment ⇒ Object
-
#initialize(seconds:, printer: Ruby::Pomodoro::Printer.new) ⇒ Progressbar
constructor
A new instance of Progressbar.
- #start(text) ⇒ Object
Constructor Details
#initialize(seconds:, printer: Ruby::Pomodoro::Printer.new) ⇒ Progressbar
Returns a new instance of Progressbar.
4 5 6 7 8 |
# File 'lib/ruby/pomodoro/progressbar.rb', line 4 def initialize(seconds:, printer: Ruby::Pomodoro::Printer.new) @all_seconds = seconds @spent_seconds = 0 @printer = printer end |
Instance Method Details
#increment ⇒ Object
14 15 16 17 |
# File 'lib/ruby/pomodoro/progressbar.rb', line 14 def increment @spent_seconds += 1 print end |
#start(text) ⇒ Object
10 11 12 |
# File 'lib/ruby/pomodoro/progressbar.rb', line 10 def start(text) @text = text end |