Sha256: cd7238d7fbc10833152922ed6a64af9f354785aacf819cdad4ec2b35dabd23d2

Contents?: true

Size: 464 Bytes

Versions: 2

Compression:

Stored size: 464 Bytes

Contents

module Vedeu
  class Clear
    def self.call(interface)
      new(interface).clear
    end

    def initialize(interface)
      @interface = interface
    end

    def clear
      rows.inject([colours]) do |line, index|
        line << interface.origin(index) { ' ' * interface.width }
      end.join
    end

    private

    attr_reader :interface

    def colours
      interface.colour.to_s
    end

    def rows
      interface.height.times
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.1.15 lib/vedeu/output/clear.rb
vedeu-0.1.14 lib/vedeu/output/clear.rb