Created
April 7, 2009 03:12
-
-
Save terrbear/91081 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Methodize | |
def initialize | |
end | |
def spitter=(lam) | |
@spitter = lam | |
end | |
def spit! | |
@spitter.call("bob") | |
end | |
end | |
def say_hi(arg) | |
puts "hello #{arg}" | |
end | |
m = Methodize.new | |
m.spitter = lambda{|arg| say_hi(arg)} | |
m.spit! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment