Name

Delegator — Delegator pattern superclass

Synopsis

Delegator is an abstract class for the Delegator design pattern. Delegation is actually achieved by creating a subclass of the Delegator class.

Required Library

require ‘delegate’

Class Method

Delegator::new(obj)

Creates a delegate object to which methods of obj are forwarded.

Instance Method

_ _getobj_ _

Returns the object to which methods are forwarded. Needs to be redefined in the subclass.

Get Ruby in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.