Sha256: fe55667a211974b2695afae00ee79423b0f65de7f3124a1bc03bf7b8f3b7f2ee

Contents?: true

Size: 376 Bytes

Versions: 4

Compression:

Stored size: 376 Bytes

Contents

# frozen_string_literal: true

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
phlex-0.5.3 lib/phlex/buffered.rb
phlex-0.5.2 lib/phlex/buffered.rb
phlex-0.5.1 lib/phlex/buffered.rb
phlex-0.5.0 lib/phlex/buffered.rb