Class: Ractor::Wrapper::Stub

Inherits:
Object
  • Object
show all
Defined in:
lib/ractor/wrapper.rb

Overview

A stub that forwards calls to a wrapper.

Instance Method Summary collapse

Constructor Details

#initialize(wrapper) ⇒ Stub

Create a stub given a wrapper.

Parameters:



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