Sha256: 1c748bcc118336aaca317e7820173ccb075ede4074ce1714f45b1a82d91c76e5

Contents?: true

Size: 1009 Bytes

Versions: 18

Compression:

Stored size: 1009 Bytes

Contents

module Vedeu

  module Renderers

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

      # @param output [Array<Array<Vedeu::Char>>]
      # @return [String]
      def self.render(*output)
        new(*output).render
      end

      # Returns a new instance of Vedeu::Renderers::Terminal.
      #
      # @param output [Array<Array<Vedeu::Char>>]
      # @return [Vedeu::Renderers::Terminal]
      def initialize(*output)
        @output = output
      end

      # @return [Array<String>]
      def render
        Vedeu::Terminal.output(parsed)
      end

      protected

      # @!attribute [r] output
      # @return [Array<Array<Vedeu::Char>>]
      attr_reader :output

      private

      # @return [String]
      def parsed
        Vedeu.timer('Compression') do
          Vedeu::Compressor.render(output)
        end
      end

    end # Terminal

  end # Renderers

end # Vedeu

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
vedeu-0.4.50 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.49 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.48 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.47 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.46 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.45 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.44 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.43 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.42 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.41 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.40 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.39 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.38 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.37 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.36 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.35 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.34 lib/vedeu/output/renderers/terminal.rb
vedeu-0.4.33 lib/vedeu/output/renderers/terminal.rb