Sha256: 7b9286e8933a1f34c15a722d33318bb6aca5ce45a92e90cc7cb7bbeaa6dc8dad

Contents?: true

Size: 790 Bytes

Versions: 5

Compression:

Stored size: 790 Bytes

Contents

module Vedeu

  # Provides access to all possible mechanisms to write content.
  #
  # @note
  #   Will be used to translate output into HTML, etc.
  #
  class Writer

    attr_reader :writers

    # @param args []
    # @return [Vedeu::Writer]
    def self.[](*args)
      new(args)
    end

    # @param writers []
    # @return [Vedeu::Writer]
    def initialize(writers)
      @writers = writers
    end

    # @param other []
    # @return [Boolean]
    def ==(other)
      writers == other.writers
    end

    # @param other []
    # @return [Vedeu::Writer]
    def +(other)
      Writer[*(writers + other.writers)]
    end

    # @param stream []
    # @return [Array]
    def write(stream)
      @writers.each { |writer| writer.write(stream) }
    end

  end # Writer

end # Vedeu

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vedeu-0.4.3 lib/vedeu/output/writer.rb
vedeu-0.4.2 lib/vedeu/output/writer.rb
vedeu-0.4.1 lib/vedeu/output/writer.rb
vedeu-0.4.0 lib/vedeu/output/writer.rb
vedeu-0.3.5 lib/vedeu/output/writer.rb