Class: Ractor::Wrapper::Stub

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

Overview

A stub that forwards calls to a wrapper.

This object is shareable and can be passed to any Ractor.

Instance Method Summary collapse

Constructor Details

#initialize(wrapper) ⇒ Stub

Create a stub given a wrapper.

Parameters:



186
187
188
189
# File 'lib/ractor/wrapper.rb', line 186

def initialize(wrapper)
  @wrapper = wrapper
  freeze
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) ⇒ Object

Forward calls to Ractor::Wrapper#call.



195
196
197
# File 'lib/ractor/wrapper.rb', line 195

def method_missing(name, ...)
  @wrapper.call(name, ...)
end