class ProgressBar::Components::Percentage
Attributes
progress[RW]
Public Class Methods
new(options = {})
click to toggle source
# File lib/ruby-progressbar/components/percentage.rb, line 6 def initialize(options = {}) self.progress = options[:progress] end
Private Instance Methods
justified_percentage()
click to toggle source
# File lib/ruby-progressbar/components/percentage.rb, line 16 def justified_percentage progress.percentage_completed.to_s.rjust(3) end
justified_percentage_with_precision()
click to toggle source
# File lib/ruby-progressbar/components/percentage.rb, line 24 def justified_percentage_with_precision progress.percentage_completed_with_precision.to_s.rjust(6) end
percentage()
click to toggle source
# File lib/ruby-progressbar/components/percentage.rb, line 12 def percentage progress.percentage_completed end
percentage_with_precision()
click to toggle source
# File lib/ruby-progressbar/components/percentage.rb, line 20 def percentage_with_precision progress.percentage_completed_with_precision end