# File lib/progress_bar/components/bar.rb, line 11 def initialize(options = {}) super self.progress_mark = options[:progress_mark] || DEFAULT_PROGRESS_MARK end
# File lib/progress_bar/components/bar.rb, line 34 def empty_string ' ' * (length - completed_length) end
# File lib/progress_bar/components/bar.rb, line 24 def integrated_percentage_complete_string return standard_complete_string if completed_length < 5 " #{percentage_completed} ".to_s.center(completed_length, progress_mark) end
# File lib/progress_bar/components/bar.rb, line 30 def standard_complete_string progress_mark * completed_length end
# File lib/progress_bar/components/bar.rb, line 17 def to_s(options = {:format => :standard}) completed_string = send(:"#{options[:format]}_complete_string") empty_string = ' ' * (length - completed_string.length) "#{completed_string}#{empty_string}" end