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

Public Instance Methods

justified_percentage() click to toggle source
# File lib/ruby-progressbar/components/percentage.rb, line 14
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 22
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 10
def percentage
  progress.percentage_completed.to_s
end
percentage_with_precision() click to toggle source
# File lib/ruby-progressbar/components/percentage.rb, line 18
def percentage_with_precision
  progress.percentage_completed_with_precision
end