Class: ProgressTasksLogger
- Inherits:
-
Object
- Object
- ProgressTasksLogger
- Defined in:
- lib/admiral-tools-figma/helper/figma/figma_image_downloader/helpers/progress_tasks_logger.rb
Instance Attribute Summary collapse
-
#current_count ⇒ Object
Returns the value of attribute current_count.
-
#total_count ⇒ Object
Returns the value of attribute total_count.
Instance Method Summary collapse
- #increment(value: 1) ⇒ Object
-
#initialize(total_count:) ⇒ ProgressTasksLogger
constructor
A new instance of ProgressTasksLogger.
- #progress_string ⇒ Object
- #reset ⇒ Object
Constructor Details
#initialize(total_count:) ⇒ ProgressTasksLogger
Returns a new instance of ProgressTasksLogger.
6 7 8 9 |
# File 'lib/admiral-tools-figma/helper/figma/figma_image_downloader/helpers/progress_tasks_logger.rb', line 6 def initialize(total_count:) @total_count = total_count @current_count = 0 end |
Instance Attribute Details
#current_count ⇒ Object
Returns the value of attribute current_count.
4 5 6 |
# File 'lib/admiral-tools-figma/helper/figma/figma_image_downloader/helpers/progress_tasks_logger.rb', line 4 def current_count @current_count end |
#total_count ⇒ Object
Returns the value of attribute total_count.
4 5 6 |
# File 'lib/admiral-tools-figma/helper/figma/figma_image_downloader/helpers/progress_tasks_logger.rb', line 4 def total_count @total_count end |
Instance Method Details
#increment(value: 1) ⇒ Object
15 16 17 |
# File 'lib/admiral-tools-figma/helper/figma/figma_image_downloader/helpers/progress_tasks_logger.rb', line 15 def increment(value: 1) self.current_count += value end |
#progress_string ⇒ Object
19 20 21 |
# File 'lib/admiral-tools-figma/helper/figma/figma_image_downloader/helpers/progress_tasks_logger.rb', line 19 def progress_string "(#{current_count}/#{total_count})" end |
#reset ⇒ Object
11 12 13 |
# File 'lib/admiral-tools-figma/helper/figma/figma_image_downloader/helpers/progress_tasks_logger.rb', line 11 def reset self.current_count = 0 end |