Ruby - Blocks, Procs, and Lambdas
Given this code, what will be the output?
def create_proc
Proc.new { |x| x.nil? ? 'No value' : x * 10 }
end
my_proc = create_proc
puts my_proc.call(nil)
puts my_proc.call(5)