Example #1
0
            public override MetaObject /*!*/ BindInvoke(InvokeBinder /*!*/ action, MetaObject /*!*/[] /*!*/ args)
            {
                RubyCallSignature callSignature;

                if (RubyCallSignature.TryCreate(action.Arguments, out callSignature))
                {
                    return(action.FallbackInvoke(this, args));
                }

                var context = new MetaObject(
                    Methods.GetContextFromProc.OpCall(AstUtils.Convert(Expression, typeof(Proc))),
                    Restrictions.Empty,
                    RubyOps.GetContextFromProc((Proc)Value)
                    );

                var metaBuilder = new MetaObjectBuilder();

                Proc.SetCallActionRule(metaBuilder, new CallArguments(context, this, args, callSignature), true);
                return(metaBuilder.CreateMetaObject(action, args));
            }