Class: Rbar::Bars::BaseBar
- Inherits:
-
Object
- Object
- Rbar::Bars::BaseBar
- Defined in:
- lib/rbar/bars/base_bar.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#parent_bar ⇒ Object
readonly
Returns the value of attribute parent_bar.
-
#progress_bar ⇒ Object
readonly
Returns the value of attribute progress_bar.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #increment ⇒ Object
-
#initialize(parent_bar:, total:, count: 0) ⇒ BaseBar
constructor
A new instance of BaseBar.
- #progress ⇒ Object
- #register_self ⇒ Object
Constructor Details
#initialize(parent_bar:, total:, count: 0) ⇒ BaseBar
8 9 10 11 12 13 |
# File 'lib/rbar/bars/base_bar.rb', line 8 def initialize(parent_bar:, total:, count: 0) @total = total = @count = count = register_self end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
35 36 37 |
# File 'lib/rbar/bars/base_bar.rb', line 35 def count @count end |
#parent_bar ⇒ Object (readonly)
Returns the value of attribute parent_bar.
35 36 37 |
# File 'lib/rbar/bars/base_bar.rb', line 35 def end |
#progress_bar ⇒ Object (readonly)
Returns the value of attribute progress_bar.
35 36 37 |
# File 'lib/rbar/bars/base_bar.rb', line 35 def end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
35 36 37 |
# File 'lib/rbar/bars/base_bar.rb', line 35 def total @total end |
Instance Method Details
#increment ⇒ Object
15 16 17 18 |
# File 'lib/rbar/bars/base_bar.rb', line 15 def increment increment_count end |
#progress ⇒ Object
31 32 33 |
# File 'lib/rbar/bars/base_bar.rb', line 31 def progress .current end |
#register_self ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rbar/bars/base_bar.rb', line 20 def register_self = .register(format, bar_format: :square, total: total, count: "0", width: TTY::Screen.width * 0.75, complete: color) .start end |