Sha256: 6ec129ec9b85e67355f6513be67a9a99c9171655d6805f8804d4266c2af065b3

Contents?: true

Size: 426 Bytes

Versions: 1

Compression:

Stored size: 426 Bytes

Contents

module Space
  class Screen
    class Progress < View
      def initialize(*)
        super
        Events.subscribe(self, :start, :update)
      end

      def notify(event)
        case event
        when :start
          clear
        when :update
          print '.'
        end
      end

      private

        def clear
          move 0, 5
          print "\e[0J" # clear from cursor down
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
space-0.0.6 lib/space/screen/progress.rb