File: multi_io.rb

package info (click to toggle)
ruby-grape-logging 1.8.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 244 kB
  • sloc: ruby: 845; makefile: 6; sh: 3
file content (15 lines) | stat: -rw-r--r-- 230 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module GrapeLogging
  class MultiIO
    def initialize(*targets)
      @targets = targets
    end

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

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