Actions
Feature #15842
closedAllow DelegateClass() to module_eval given block
Status:
Closed
Assignee:
-
Target version:
-
Description
Methods that return classes often module_eval the given block
(e.g. Class.new
and Struct.new
). This allows DelegateClass
to
work similarly. This makes it easier to use DelegateClass
directly without subclassing, so as not to create an unnecessary
intermediate class. Example:
MyClass = DelegateClass(ClassToDelegateTo) do
def initialize
super(obj_of_ClassToDelegateTo)
end
end
Attached is a patch that implements this proposal.
Files
Actions
Like0
Like0Like0