Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Forwardable#instance_delegate

delegate method => accessor delegate [method, method, ...] => accessor

Takes a hash as its argument. The key is a symbol or an array of symbols. These symbols correspond to method names, instance variable names, or constant names (see def_delegator). The value is the accessor to which the methods will be delegated.

See also #delegate #def_instance_delegators also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0