Class: Archsight::Import::ConcurrentProgress::SlotProgress
- Inherits:
-
Object
- Object
- Archsight::Import::ConcurrentProgress::SlotProgress
- Defined in:
- lib/archsight/import/concurrent_progress.rb
Overview
Individual slot progress reporter
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#slot_id ⇒ Object
readonly
Returns the value of attribute slot_id.
Instance Method Summary collapse
- #complete(message = nil) ⇒ Object
- #error(message) ⇒ Object
-
#initialize(parent, slot_id, context) ⇒ SlotProgress
constructor
A new instance of SlotProgress.
- #release ⇒ Object
- #update(message, current: nil, total: nil) ⇒ Object
- #warn(message) ⇒ Object
Constructor Details
#initialize(parent, slot_id, context) ⇒ SlotProgress
Returns a new instance of SlotProgress.
314 315 316 317 318 |
# File 'lib/archsight/import/concurrent_progress.rb', line 314 def initialize(parent, slot_id, context) @parent = parent @slot_id = slot_id @context = context end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
312 313 314 |
# File 'lib/archsight/import/concurrent_progress.rb', line 312 def context @context end |
#slot_id ⇒ Object (readonly)
Returns the value of attribute slot_id.
311 312 313 |
# File 'lib/archsight/import/concurrent_progress.rb', line 311 def slot_id @slot_id end |
Instance Method Details
#complete(message = nil) ⇒ Object
324 325 326 |
# File 'lib/archsight/import/concurrent_progress.rb', line 324 def complete( = nil) @parent.complete_slot(@slot_id, @context, ) end |
#error(message) ⇒ Object
328 329 330 |
# File 'lib/archsight/import/concurrent_progress.rb', line 328 def error() @parent.error_slot(@slot_id, @context, ) end |
#release ⇒ Object
337 338 339 |
# File 'lib/archsight/import/concurrent_progress.rb', line 337 def release @parent.release_slot(@slot_id) end |
#update(message, current: nil, total: nil) ⇒ Object
320 321 322 |
# File 'lib/archsight/import/concurrent_progress.rb', line 320 def update(, current: nil, total: nil) @parent.update_slot(@slot_id, @context, , current: current, total: total) end |
#warn(message) ⇒ Object
332 333 334 335 |
# File 'lib/archsight/import/concurrent_progress.rb', line 332 def warn() # Warnings are shown inline with the current context (yellow in TTY mode) @parent.update_slot(@slot_id, @context, "Warning: #{}", color: COLORS[:yellow]) end |