作者:nicknick-AUG | 来源:互联网 | 2023-05-27 08:09
1> Jiří Pospíši..:
another_method
直到你打电话后才定义.您需要将其定义移到您调用它的方法/位置之上.
def block_trial alfa, &block
puts alfa
block.call
end
def another_method
puts "another_method"
end
block_trial "Trial" do
puts "Komodo"
another_method
end