Sha256: 46c299cfb089919e2e94da979f9238f80ecaa099ecaffa6ba8ee09a1c29c86aa

Contents?: true

Size: 547 Bytes

Versions: 8

Compression:

Stored size: 547 Bytes

Contents

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

    def initialize(interface)
      @interface = interface
    end

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

    private

    attr_reader :interface

    def colours
      interface.colour.to_s
    end

    def interface_lines
      interface.height.times
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vedeu-0.1.3 lib/vedeu/output/clear_interface.rb
vedeu-0.1.2 lib/vedeu/output/clear_interface.rb
vedeu-0.1.1 lib/vedeu/output/clear_interface.rb
vedeu-0.1.0 lib/vedeu/output/clear_interface.rb
vedeu-0.0.42 lib/vedeu/output/clear_interface.rb
vedeu-0.0.41 lib/vedeu/output/clear_interface.rb
vedeu-0.0.40 lib/vedeu/output/clear_interface.rb
vedeu-0.0.39 lib/vedeu/output/clear_interface.rb