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
-
#call ⇒ Object
private
Forward some methods to the original underlying method.
-
#initialize(object) ⇒ Unbuffered
constructor
private
A new instance of Unbuffered.
- #inspect ⇒ Object private
- #method_missing(name, *args, **kwargs, &block) ⇒ Object private
- #public_send ⇒ Object private
- #respond_to_missing? ⇒ Boolean private
- #send ⇒ Object private
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
#call ⇒ 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.
Forward some methods to the original underlying method
39 40 41 |
# File 'lib/phlex/unbuffered.rb', line 39 def call(...) @object.call(...) end |
#inspect ⇒ 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.
9 10 11 |
# File 'lib/phlex/unbuffered.rb', line 9 def inspect "Unbuffered(#{@object.class.name})[object: #{@object.inspect}]" end |
#public_send ⇒ 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.
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.
20 21 22 |
# File 'lib/phlex/unbuffered.rb', line 20 def respond_to_missing?(...) @object.respond_to?(...) end |
#send ⇒ 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.
43 44 45 |
# File 'lib/phlex/unbuffered.rb', line 43 def send(...) @object.send(...) end |