Sha256: aa4d2254b27127effb0120915e575ef6a7a3a8f3895fbb2aeaa2d6e57436a378

Contents?: true

Size: 356 Bytes

Versions: 7

Compression:

Stored size: 356 Bytes

Contents

# frozen_string_literal: true

require "delegate"

module Phlex
	class Buffered < SimpleDelegator
		def initialize(object, buffer:)
			super(object)
			@buffer = buffer
		end

		# Alias output methods to this
		def __output_method__(...)
			output = __getobj__.public_send(__callee__, ...)
			@buffer << output if output.is_a? String
			nil
		end
	end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
phlex-1.2.2 lib/phlex/buffered.rb
phlex-1.3.3 lib/phlex/buffered.rb
phlex-1.3.2 lib/phlex/buffered.rb
phlex-1.3.1 lib/phlex/buffered.rb
phlex-1.3.0 lib/phlex/buffered.rb
phlex-1.2.1 lib/phlex/buffered.rb
phlex-1.2.0 lib/phlex/buffered.rb