Class: ProgressBar::Components::Time
- Inherits:
-
Object
- Object
- ProgressBar::Components::Time
- Defined in:
- lib/ruby-progressbar/components/time.rb
Constant Summary collapse
- TIME_FORMAT =
'%02d:%02d:%02d'
- OOB_TIME_FORMATS =
[:unknown, :friendly, nil]
- OOB_LIMIT_IN_HOURS =
99
- OOB_UNKNOWN_TIME_TEXT =
'??:??:??'
- OOB_FRIENDLY_TIME_TEXT =
'> 4 Days'
- NO_TIME_ELAPSED_TEXT =
'--:--:--'
- ESTIMATED_LABEL =
' ETA'
- ELAPSED_LABEL =
'Time'
Instance Method Summary collapse
- #elapsed_with_label ⇒ Object
- #estimated_with_label ⇒ Object
-
#initialize(options = {}) ⇒ Time
constructor
A new instance of Time.
Constructor Details
#initialize(options = {}) ⇒ Time
Returns a new instance of Time.
16 17 18 19 20 |
# File 'lib/ruby-progressbar/components/time.rb', line 16 def initialize( = {}) self.out_of_bounds_time_format = [:out_of_bounds_time_format] self.timer = [:timer] self.progress = [:progress] end |
Instance Method Details
#elapsed_with_label ⇒ Object
26 27 28 |
# File 'lib/ruby-progressbar/components/time.rb', line 26 def elapsed_with_label "#{ELAPSED_LABEL}: #{elapsed}" end |
#estimated_with_label ⇒ Object
22 23 24 |
# File 'lib/ruby-progressbar/components/time.rb', line 22 def estimated_with_label "#{ESTIMATED_LABEL}: #{estimated}" end |