Skip to content

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

instance method

Forwardable#def_instance_delegators

def_instance_delegators(accessor, *methods)

Shortcut for defining multiple delegator methods, but with no provision for using a different name. The following two code samples have the same effect:

Example
def_delegators :@records, :size, :<<, :map

def_delegator :@records, :size
def_delegator :@records, :<<
def_delegator :@records, :map