Files
dockerfiles/tests/ruby/testcase/yieldingwithparameters.rb
2019-08-04 22:54:34 -07:00

10 lines
251 B
Ruby

def yield_name(name)
puts "In the method! Let's yield."
yield name
puts "Block complete! Back in the method."
end
yield_name("Eric") { |name| puts "My name is #{name}." }
# Now call the method with your name!
yield_name("jared"){|m| puts "ok"}