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.69 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.68 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.67 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.66 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.65 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.64 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.63 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.62 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.61 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.60 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.59 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.58 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.57 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.56 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.54 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.53 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.52 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.51 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.50 lib/vedeu/output/renderers/terminal.rb
vedeu-0.6.49 lib/vedeu/output/renderers/terminal.rb