Sha256: 3b4ef6307f901fa98a0d1ad4aa7a98f81a5fbc90c8fb71aa272fd200e2561923

Contents?: true

Size: 410 Bytes

Versions: 37

Compression:

Stored size: 410 Bytes

Contents

module Arql
  class MultiIO
    def initialize(*targets)
      @targets = targets
    end

    def write(*args)
      @targets.each {|t| t.write(*args)}
    end

    def close
      @targets.each(&:close)
    end

    def <<(target)
      @targets ||= []
      @targets << target
    end

    def delete(io)
      @targets.delete(io)
    end

    def include?(io)
      @targets.include?(io)
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
arql-0.3.3 lib/arql/multi_io.rb
arql-0.3.2 lib/arql/multi_io.rb
arql-0.3.1 lib/arql/multi_io.rb
arql-0.3.0 lib/arql/multi_io.rb
arql-0.2.14 lib/arql/multi_io.rb
arql-0.2.13 lib/arql/multi_io.rb
arql-0.2.12 lib/arql/multi_io.rb
arql-0.2.11 lib/arql/multi_io.rb
arql-0.2.10 lib/arql/multi_io.rb
arql-0.2.9 lib/arql/multi_io.rb
arql-0.2.8 lib/arql/multi_io.rb
arql-0.2.7 lib/arql/multi_io.rb
arql-0.2.6 lib/arql/multi_io.rb
arql-0.2.5 lib/arql/multi_io.rb
arql-0.2.4 lib/arql/multi_io.rb
arql-0.2.3 lib/arql/multi_io.rb
arql-0.2.2 lib/arql/multi_io.rb
arql-0.2.1 lib/arql/multi_io.rb
arql-0.2.0 lib/arql/multi_io.rb
arql-0.1.33 lib/arql/multi_io.rb