Project

General

Profile

Feature #8046

allow Object#extend to take a block

Added by phluid61 (Matthew Kerwin) almost 8 years ago. Updated about 3 years ago.

Status:
Open
Priority:
Normal
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

Also available in: Atom PDF