class Phlex::Unbuffered

def self.call(object)

def self.call(object)
	decorator = CACHE[object.class.name] ||= ::Class.new(self)
	decorator.new(object)
end

def __forward_method__(*args, &block)

def __forward_method__(*args, &block)
	@object.public_send(__callee__, *args, &block)
end

def __output_method__(*args, &block)

This method is designed to be aliased and references the callee which is whatever alias you called.
def __output_method__(*args, &block)
	@object.capture { @object.public_send(__callee__, *args, &block) }
end

def initialize(object)

def initialize(object)
	@object = object
end

def inspect

def inspect
	"Unbuffered(#{@object.class.name})[object: #{@object.inspect}]"
end

def method_missing(name, *args, &block)

def method_missing(name, *args, &block)
	if @object.respond_to?(name)
		# If the object responds to this method, we want to define it by aliasing the __output_method__.
		__class__.alias_method(name, :__output_method__)
		# Now we've defined this missing method, we can call it.
		__public_send__(name, *args, &block)
	else
		super
	end
end

def respond_to_missing?(...)

def respond_to_missing?(...)
	@object.respond_to?(...)
end