Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Precedence between ruby blocks
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
You can’t perform that action at this time.