Skip to content

Commit 1274225

Browse files
committed
Refactor: Rename time to time_component
1 parent 99281be commit 1274225

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

lib/ruby-progressbar/base.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ def initialize(options = {}) # rubocop:disable Metrics/AbcSize
3333
self.timer = Timer.new(options)
3434
self.progressable = Progress.new(options)
3535

36-
options = options.merge(:timer => timer,
37-
:progress => progressable)
36+
options = options.merge(:progress => progressable,
37+
:timer => timer)
3838

3939
self.title_component = Components::Title.new(options)
4040
self.bar_component = Components::Bar.new(options)
4141
self.percentage_component = Components::Percentage.new(options)
4242
self.rate_component = Components::Rate.new(options)
43-
self.time = Components::Time.new(options)
43+
self.time_component = Components::Time.new(options)
4444

4545
self.output = Output.detect(options.merge(:bar => self))
4646
@format = Format::String.new(output.resolve_format(options[:format]))
@@ -146,8 +146,8 @@ def to_h
146146
'progress' => progressable.progress,
147147
'total' => progressable.total,
148148
'percentage' => progressable.percentage_completed_with_precision.to_f,
149-
'elapsed_time_in_seconds' => time.__send__(:timer).elapsed_seconds,
150-
'estimated_time_remaining_in_seconds' => time.__send__(:estimated_seconds_remaining),
149+
'elapsed_time_in_seconds' => time_component.__send__(:timer).elapsed_seconds,
150+
'estimated_time_remaining_in_seconds' => time_component.__send__(:estimated_seconds_remaining),
151151
'base_rate_of_change' => rate_component.__send__(:base_rate),
152152
'scaled_rate_of_change' => rate_component.__send__(:scaled_rate),
153153
'unknown_progress_animation_steps' => bar_component.upa_steps,
@@ -180,7 +180,7 @@ def format=(other)
180180
:bar_component,
181181
:percentage_component,
182182
:rate_component,
183-
:time,
183+
:time_component,
184184
:autostart,
185185
:autofinish,
186186
:finished

lib/ruby-progressbar/format/molecule.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ class Molecule
1111
:P => [:percentage_component, :percentage_with_precision],
1212
:j => [:percentage_component, :justified_percentage],
1313
:J => [:percentage_component, :justified_percentage_with_precision],
14-
:a => [:time, :elapsed_with_label],
15-
:e => [:time, :estimated_with_unknown_oob],
16-
:E => [:time, :estimated_with_friendly_oob],
17-
:f => [:time, :estimated_with_no_oob],
18-
:l => [:time, :estimated_wall_clock],
14+
:a => [:time_component, :elapsed_with_label],
15+
:e => [:time_component, :estimated_with_unknown_oob],
16+
:E => [:time_component, :estimated_with_friendly_oob],
17+
:f => [:time_component, :estimated_with_no_oob],
18+
:l => [:time_component, :estimated_wall_clock],
1919
:B => [:bar_component, :complete_bar],
2020
:b => [:bar_component, :bar],
2121
:W => [:bar_component, :complete_bar_with_percentage],

0 commit comments

Comments
 (0)