Project

General

Profile

Actions

Feature #8046

open

allow Object#extend to take a block

Feature #8046: allow Object#extend to take a block

Added by phluid61 (Matthew Kerwin) over 13 years ago. Updated almost 9 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:53211]

Description

=begin
In #8038 david_macmahon proposed:

How about allowing Object#extend to take a block that would be executed with the context such that methods defined therein would become singleton methods of the object receiving #extend?

For example:
foo = Object.new
foo.extend do
def bar
# ...
end
def baz
# ...
end
end
=end


Related issues 1 (0 open — 1 closed)

Related to Ruby - Feature #22513: Allow Kernel#extend and Module#prepend to take a blockRejectedActions
Actions

Also available in: PDF Atom