Sha256: 5e9644c1ce28fd0b6f15e473b4994b9a4d637e7dfcf7eec96363380dbb0106ff

Contents?: true

Size: 866 Bytes

Versions: 11

Compression:

Stored size: 866 Bytes

Contents

module Vedeu

  module Renderers

    # Converts a grid of {Vedeu::Char} objects into a stream of escape sequences
    # and content.
    class Text

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

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

      # @return [String]
      def render
        parsed
      end

      protected

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

      private

      # @return [String]
      def parsed
        Vedeu::Compressor.new(output).render
      end

    end # Text

  end # Renderers

end # Vedeu

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vedeu-0.4.29 lib/vedeu/output/renderers/text.rb
vedeu-0.4.28 lib/vedeu/output/renderers/text.rb
vedeu-0.4.27 lib/vedeu/output/renderers/text.rb
vedeu-0.4.26 lib/vedeu/output/renderers/text.rb
vedeu-0.4.25 lib/vedeu/output/renderers/text.rb
vedeu-0.4.24 lib/vedeu/output/renderers/text.rb
vedeu-0.4.23 lib/vedeu/output/renderers/text.rb
vedeu-0.4.22 lib/vedeu/output/renderers/text.rb
vedeu-0.4.21 lib/vedeu/output/renderers/text.rb
vedeu-0.4.20 lib/vedeu/output/renderers/text.rb
vedeu-0.4.19 lib/vedeu/output/renderers/text.rb