An explicit &block parameter stores the caller's block so the method can call it later.

Block Argument

block_argument.rb
def apply(value, &block)
  block.call(value)
end

factor = 
base = 4

result = apply(base) do |number|
  number * factor
end

puts "base=#{base}"
puts "factor=#{factor}"
puts "result=#{result}"
def apply(value, &block)
  block.call(value)
end

factor = 
base = 4

result = apply(base) do |number|
  number * factor
end

puts "base=#{base}"
puts "factor=#{factor}"
puts "result=#{result}"
def apply(value, &block)
  block.call(value)
end

factor = 
base = 4

result = apply(base) do |number|
  number * factor
end

puts "base=#{base}"
puts "factor=#{factor}"
puts "result=#{result}"
block argument `&block` turns the passed block into an object that responds to `call`.