Sha256: 33c5295f23cfc5716f04c844df06a481c39b462c7b909b378fcec58d8b7bb85a

Contents?: true

Size: 804 Bytes

Versions: 1

Compression:

Stored size: 804 Bytes

Contents

# coding: utf-8

module TTY
  class ProgressBar
    class Formatter
      extend Forwardable

      def_delegators :@pipeline, :decorate, :use

      # @api private
      def initialize(pipeline = nil)
        @pipeline = TTY::ProgressBar::Pipeline.new
      end

      # Prepare default pipeline formatters
      #
      # @api private
      def load
        @pipeline.use TTY::ProgressBar::CurrentFormatter
        @pipeline.use TTY::ProgressBar::TotalFormatter
        @pipeline.use TTY::ProgressBar::ElapsedFormatter
        @pipeline.use TTY::ProgressBar::EstimatedFormatter
        @pipeline.use TTY::ProgressBar::PercentFormatter
        @pipeline.use TTY::ProgressBar::ByteFormatter
        @pipeline.use TTY::ProgressBar::BarFormatter
      end
    end # Formatter
  end # ProgressBar
end # TTY

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tty-progressbar-0.3.0 lib/tty/progressbar/formatter.rb