class MyClass def fun a = 2 b = 5 yield(a,b) end def self.fun2 puts self end end m = 1 n = 2 mine = MyClass.new mine.fun {|m| puts "m = #{m} n = #{n}"} Here I deliberately do not match the number of parameters for yield, and the output is
test.rb:16: warning: multiple values for a block parameter (2 for 1) from test.rb:5 m = 25 n = 2 Where does this 25 come from?