Sha256: da56999802925d2f6e09c7a1aa9c8726bbde6b06c830c7131abdb4d9cfb0d1fc

Contents?: true

Size: 982 Bytes

Versions: 48

Compression:

Stored size: 982 Bytes

Contents

module Vedeu

  module Renderers

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

      include Vedeu::Renderers::Options

      # Returns a new instance of Vedeu::Renderers::Terminal.
      #
      # @param options [Hash]
      # @return [Vedeu::Renderers::Terminal]
      def initialize(options = {})
        @options = options || {}
      end

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

      # @param output [Vedeu::Models::Page]
      # @return [Array<String>]
      def render(output)
        Vedeu::Terminal.output(parse(output))
      end

      private

      # @param output [Vedeu::Models::Page]
      # @return [Array<Array<Vedeu::Views::Char>>]
      def parse(output)
        Vedeu::Output::Compressor.render(output)
      end

    end # Terminal

  end # Renderers

end # Vedeu

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
vedeu-0.6.48 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.47 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.46 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.45 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.44 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.43 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.42 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.41 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.40 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.39 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.38 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.37 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.36 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.35 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.34 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.33 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.32 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.31 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.30 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.29 lib/vedeu/output/renderers/terminal.rb