/// <exception cref="MissingMethodException">The resolved method is Kernel#method_missing.</exception>
internal static void Bind(MetaObjectBuilder /*!*/ metaBuilder, string /*!*/ methodName, CallArguments /*!*/ args)
{
metaBuilder.AddTargetTypeTest(args);
RubyMemberInfo method = args.RubyContext.ResolveMethod(args.Target, methodName, true).InvalidateSitesOnOverride();
if (method != null && RubyModule.IsMethodVisible(method, args.Signature.HasImplicitSelf))
{
method.BuildCall(metaBuilder, args, methodName);
}
else
{
// insert the method name argument into the args
object symbol = SymbolTable.StringToId(methodName);
args.InsertSimple(0, new MetaObject(Ast.Constant(symbol), Restrictions.Empty, symbol));
BindToMethodMissing(metaBuilder, methodName, args, method != null);
}
}