Class: Kettle::Dev::CacheProgress
- Inherits:
-
Object
- Object
- Kettle::Dev::CacheProgress
- Defined in:
- lib/kettle/dev/cache_progress.rb
Constant Summary collapse
- FORMAT =
"%t %b %c/%C"- LENGTH =
30
Instance Attribute Summary collapse
-
#cached_count ⇒ Object
readonly
Returns the value of attribute cached_count.
-
#live_count ⇒ Object
readonly
Returns the value of attribute live_count.
-
#skipped_count ⇒ Object
readonly
Returns the value of attribute skipped_count.
Instance Method Summary collapse
- #cached ⇒ Object
-
#initialize(total:, cached_title:, live_title:, output:, enabled: true, skipped_title: nil) ⇒ CacheProgress
constructor
A new instance of CacheProgress.
- #live ⇒ Object
- #skipped ⇒ Object
Constructor Details
#initialize(total:, cached_title:, live_title:, output:, enabled: true, skipped_title: nil) ⇒ CacheProgress
Returns a new instance of CacheProgress.
11 12 13 14 15 16 17 18 19 |
# File 'lib/kettle/dev/cache_progress.rb', line 11 def initialize(total:, cached_title:, live_title:, output:, enabled: true, skipped_title: nil) @total = total.to_i @cached_count = 0 @live_count = 0 @skipped_count = 0 @cached_bar = (cached_title, output, enabled) @live_bar = (live_title, output, enabled) @skipped_bar = skipped_title ? (skipped_title, output, enabled) : nil end |
Instance Attribute Details
#cached_count ⇒ Object (readonly)
Returns the value of attribute cached_count.
21 22 23 |
# File 'lib/kettle/dev/cache_progress.rb', line 21 def cached_count @cached_count end |
#live_count ⇒ Object (readonly)
Returns the value of attribute live_count.
21 22 23 |
# File 'lib/kettle/dev/cache_progress.rb', line 21 def live_count @live_count end |
#skipped_count ⇒ Object (readonly)
Returns the value of attribute skipped_count.
21 22 23 |
# File 'lib/kettle/dev/cache_progress.rb', line 21 def skipped_count @skipped_count end |
Instance Method Details
#cached ⇒ Object
23 24 25 26 |
# File 'lib/kettle/dev/cache_progress.rb', line 23 def cached @cached_count += 1 @cached_bar&.increment end |
#live ⇒ Object
28 29 30 31 |
# File 'lib/kettle/dev/cache_progress.rb', line 28 def live @live_count += 1 @live_bar&.increment end |
#skipped ⇒ Object
33 34 35 36 |
# File 'lib/kettle/dev/cache_progress.rb', line 33 def skipped @skipped_count += 1 @skipped_bar&.increment end |