module ProgressBar::Formatter

Constants

DEFAULT_FORMAT_STRING
DEFAULT_TITLE

Public Class Methods

new(options) click to toggle source
# File lib/progress_bar/formatter.rb, line 6
def initialize(options)
  self.format_string = options[:format] || DEFAULT_FORMAT_STRING
  @title             = options[:title]  || DEFAULT_TITLE

  super(options)
end

Public Instance Methods

format(new_format_string = DEFAULT_FORMAT_STRING) click to toggle source
# File lib/progress_bar/formatter.rb, line 13
def format(new_format_string = DEFAULT_FORMAT_STRING)
  self.format_string = new_format_string
  @format.process(self)
end
progress() click to toggle source
# File lib/progress_bar/formatter.rb, line 22
def progress
  @bar.progress
end
title=(title) click to toggle source
# File lib/progress_bar/formatter.rb, line 18
def title=(title)
  @title = title
end
total() click to toggle source
# File lib/progress_bar/formatter.rb, line 26
def total
  @bar.total
end