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

SingleForwardable#def_delegator

def_delegator(accessor, method, ali = method)

Alias of #def_single_delegator

Defines a method method which delegates to accessor (i.e. it calls the method of the same name in accessor). If new_name is provided, it is used as the name for the delegate method. Returns the name of the method defined.

See also #def_single_delegator #def_delegators also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0