Created
October 31, 2012 17:44
-
-
Save MikeSilvis/3988606 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def pass_my_block(&block) | |
puts "Hi Paul!" | |
yield | |
puts "Bye Paul!" | |
end | |
pass_my_block do | |
puts "You smell" | |
end | |
=> | |
HI Paul! | |
You smell | |
Bye Paul! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
function pass_my_block($block) {
echo("Hi Mike");
$block();
echo("Bye mike");
}
$block = function() { echo("you smell"); }