The Code passed but not quite understood how this "Yield" works. Please Explain!


#1

<

def yield_name(name)
  puts "In the method! Let's yield."
  yield("Kim")
  puts "In between the yields!"
  yield(name)
  puts "Block complete! Back in the method."
end

yield_name("Eric") { |n| puts "My name is #{n}." }

yield_name("Ayush") { |a| puts "My name is #{a}." }

/>