Sha256: 97943b197fcc53aa61d478ef37ed32a753d648facf8a543d0f407362a85722a2

Contents?: true

Size: 884 Bytes

Versions: 18

Compression:

Stored size: 884 Bytes

Contents

module Vedeu

  # Sends the content to the renderers.
  #
  # @api private
  class Output

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

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

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

        Vedeu::Renderers::HTML.to_file(Vedeu::VirtualBuffer.retrieve)
      end

      Vedeu.renderers.render(content)
    end

    protected

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

  end # Output

end # Vedeu

Version data entries

18 entries across 18 versions & 1 rubygems

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