So I am trying to write the method_missing in Ruby, the method_missing has three parameter as shown
def method_missing(mId,*args,&block)
if (args.empty? && !block_given?)
puts " Sample One No arguments were given nor block"
elsif (!args.entries.empty?)
puts " there was arguments given"
elsif (block_given?)
puts "there was ?code given"
end
end
The problem calling instance.anything { " block" } always returns " Sample One No arguments were given nor block". it's clear that block_given always returns false , but why?