Thread: Ruby Snippets
View Single Post
Old Jul 9th, 2006, 9:13 PM   #33
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
class Symbol
    def to_proc
        lambda { |obj, *args| obj.send(self, *args) }
    end
end
Is this what some folks refer to as metaprogramming?
__________________
I looked it up on the Intergnats!
Dietrich is offline   Reply With Quote