幽灵方法:动态生成方法 2015/05/07 14690 class Lawyer def method_missing(method, *args) puts "You called: #{method} (#{args.join(', ')})" puts "You also passed it a block" if block_given? end end nick = Lawyer.new nick.talk_simple('a', 'b') do # a block end