Skip to content

Instantly share code, notes, and snippets.

@jgaskins
Created May 24, 2012 20:44
Show Gist options
  • Save jgaskins/2784127 to your computer and use it in GitHub Desktop.
Save jgaskins/2784127 to your computer and use it in GitHub Desktop.
Blocks are, indeed, represented as Proc objects
def m &block
block
end
def n &block
block.call
end
p n(&m { 'This is my block' })
# => "This is my block"
p n &(Proc.new { 'This is another block' })
# => "This is another block"
p m { 'Another block' }.class
# => Proc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment