Class: Ractor::Wrapper::Stub
- Inherits:
-
Object
- Object
- Ractor::Wrapper::Stub
- Defined in:
- lib/ractor/wrapper.rb
Overview
A stub that forwards calls to a wrapper.
Instance Method Summary collapse
-
#initialize(wrapper) ⇒ Stub
constructor
Create a stub given a wrapper.
-
#method_missing(name, *args, **kwargs) ⇒ Object
Forward calls to #call.
Constructor Details
#initialize(wrapper) ⇒ Stub
Create a stub given a wrapper.
272 273 274 275 |
# File 'lib/ractor/wrapper.rb', line 272 def initialize(wrapper) @wrapper = wrapper freeze end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, **kwargs) ⇒ Object
Forward calls to Ractor::Wrapper#call.
280 281 282 |
# File 'lib/ractor/wrapper.rb', line 280 def method_missing(name, *args, **kwargs) @wrapper.call(name, *args, **kwargs) end |