From: merch-redmine@... Date: 2019-05-11T23:40:39+00:00 Subject: [ruby-core:92623] [Ruby trunk Feature#15842] Allow DelegateClass() to module_eval given block Issue #15842 has been reported by jeremyevans0 (Jeremy Evans). ---------------------------------------- Feature #15842: Allow DelegateClass() to module_eval given block https://bugs.ruby-lang.org/issues/15842 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- 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: ```ruby MyClass = DelegateClass(ClassToDelegateTo) do def initialize super(obj_of_ClassToDelegateTo) end end ``` Attached is a patch that implements this proposal. ---Files-------------------------------- delegate-class-block.patch (2.26 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: