Class: Phlex::Unbuffered Private

Inherits:
BasicObject
Defined in:
lib/phlex/unbuffered.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ Unbuffered

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Unbuffered.



5
6
7
# File 'lib/phlex/unbuffered.rb', line 5

def initialize(object)
	@object = object
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, **kwargs, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/phlex/unbuffered.rb', line 24

def method_missing(name, *args, **kwargs, &block)
	if @object.respond_to?(name)

		__class__.define_method(name) do |*a, **k, &b|
			@object.capture { @object.public_send(name, *a, **k, &b) }
		end

		# Now we've defined this missing method, we can call it.
		__public_send__(name, *args, **kwargs, &block)
	else
		super
	end
end

Instance Method Details

#callObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Forward some methods to the original underlying method



39
40
41
# File 'lib/phlex/unbuffered.rb', line 39

def call(...)
	@object.call(...)
end

#inspectObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/phlex/unbuffered.rb', line 9

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

#public_sendObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



47
48
49
# File 'lib/phlex/unbuffered.rb', line 47

def public_send(...)
	@object.public_send(...)
end

#respond_to_missing?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


20
21
22
# File 'lib/phlex/unbuffered.rb', line 20

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

#sendObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



43
44
45
# File 'lib/phlex/unbuffered.rb', line 43

def send(...)
	@object.send(...)
end