Using the missing method Parameters | Parameter | Details | | method | The name of the method that has been called (in the above example this is :say_moo, note that this is a symbol. | | *args | The arguments passed in to this method. Can be any number, or none | | &block | The block of the method called, this can either be a do block, or a { } enclosed block | Always call super, at the bottom of this function. This saves silent failure when something is called and you don't get an error. For example, this method_missing is going to cause problems: method_missing is a good tool to use when appropriate, but has two costs you should consider. First, method_missing is less efficient -- ruby must search the class and all of its ancestors before it can fall back on this approach; this performance penalty may be trivial in a simple case, but can add up. Second and more broadly, this is a form of meta-programming that has great power that comes with responsibility to ensure that the implementation is secure, properly handles malicious inputs, unexpected inputs, and so on. You should also override respond_to_missing? like so: |