Last active
August 29, 2015 14:02
-
-
Save jheg/667bd3e9c0b597e43f4e 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
def take_block(number, &block) | |
block.call | |
end | |
[1, 2, 3, 4, 5].each do |number| | |
take_block number do | |
puts "Block being called in the method! #{number}" | |
end | |
end | |
does the same as? | |
[1, 2, 3, 4, 5].each do |number| | |
puts "Block being called in the method! #{number}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment