Skip to content

Instantly share code, notes, and snippets.

@terrbear
Created April 7, 2009 03:12
Show Gist options
  • Save terrbear/91081 to your computer and use it in GitHub Desktop.
Save terrbear/91081 to your computer and use it in GitHub Desktop.
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