Sha256: 26d17bf729a0b6ac284371c4f02978f57662feb57de539cc88a5ef5a7fd88c00

Contents?: true

Size: 888 Bytes

Versions: 2

Compression:

Stored size: 888 Bytes

Contents

module Vedeu

  # Sends the output to the renderers.
  #
  class Output

    # Writes output to the defined renderers.
    #
    # @return [Array|String]
    # @see #initialize
    def self.render(output)
      new(output).render
    end

    # Return a new instance of Vedeu::Output.
    #
    # @param output [Array<Array<Vedeu::Views::Char>>]
    # @return [Output]
    def initialize(output)
      @output = output
    end

    # Send the view to the renderers.
    #
    # @return [Array]
    def render
      if Vedeu::Configuration.drb?
        Vedeu.trigger(:_drb_store_output_, output)

        # Vedeu::Renderers::HTML.to_file(Vedeu::VirtualBuffers.retrieve)
      end

      Vedeu.renderers.render(output) if Vedeu.ready?
    end

    protected

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

  end # Output

end # Vedeu

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.5.12 lib/vedeu/output/output.rb
vedeu-0.5.11 lib/vedeu/output/output.rb