# Re: better alias\_method

**URL:** <https://www.ruby-forum.com/t/re-better-alias-method/68042>\
**Category:** Ruby\
**Created:** [September 8, 2006, 6:40pm UTC](https://www.ruby-forum.com/t/re-better-alias-method/68042 "2006-09-08T18:40:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [September 8, 2006, 6:40pm UTC](https://www.ruby-forum.com/t/re-better-alias-method/68042/1 "2006-09-08T18:40:35Z")

</div>

From: removed\_email\_address@domain.invalid [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]

> i remember that define\_method will soon have the ability to  
> define methods that take blocks do you know if that’s in  
> 1.8.5 or the 1.9 branch?

Not in 1.8.5:

p RUBY\_VERSION  
#=\> 1.8.5

class Foo  
def self.make\_method( name, &block )  
define\_method( name, &block )  
end  
end

Foo.make\_method( :bar ){ |a|  
p a, block\_given?  
yield a if block\_given?  
}

f = Foo.new  
f.bar( 3 ){ |x| p x\*x }  
#=\> 3  
#=\> false
