Created
July 11, 2014 16:57
-
-
Save scudelletti/d74a85cdd7b39a735ff6 to your computer and use it in GitHub Desktop.
Precedence between ruby blocks
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 first_function(something, &block) | |
puts "First - Do I have a Block? #{block_given?}" | |
end | |
def second_function(&block) | |
puts "Second - Do I have a Block? #{block_given?}" | |
end | |
puts "USING: {}" | |
first_function second_function { 'YEAP' } | |
puts | |
puts "USING: do/end" | |
first_function second_function do 'YEAP' end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment