Sha256: 35b78b3e3790257110b8e22d92d42b5e8c3454e8c66eb7d4b1b5b3a68de8fe13

Contents?: true

Size: 789 Bytes

Versions: 3

Compression:

Stored size: 789 Bytes

Contents

# frozen_string_literal: true

module Vedeu

  module Renderers

    # Converts a grid of {Vedeu::Cells::Char} objects into a stream of
    # escape sequences and content suitable for a terminal.
    #
    class Terminal

      include Vedeu::Renderers::Options

      # Render a cleared output.
      #
      # @return [String]
      def clear
        Vedeu::Terminal.clear

        render('')
      end

      # Render the output (either content or clearing) to the console.
      #
      # @return [String]
      def write
        if write_file?
          Vedeu::Terminal.output(write_file)

        else
          Vedeu::Terminal.output(content)

        end
      end

      private

      def content
        compression
      end

    end # Terminal

  end # Renderers

end # Vedeu

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vedeu-0.8.5 lib/vedeu/renderers/terminal.rb
vedeu-0.8.4 lib/vedeu/renderers/terminal.rb
vedeu-0.8.3 lib/vedeu/renderers/terminal.rb