Skip to content

Instantly share code, notes, and snippets.

@Jacke
Created July 7, 2013 22:39
Show Gist options
  • Select an option

  • Save Jacke/5945238 to your computer and use it in GitHub Desktop.

Select an option

Save Jacke/5945238 to your computer and use it in GitHub Desktop.
Proc to block convertation
def m1 &block
m2 &block
end
def m2
yield
end
m1 {puts "hello"} # hello
a = Proc.new {puts "world"}
m2 &a # world
def m3 block
instance_eval &block
end
m3 a # world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment