Exemplo n.º 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 metaBuilder = new MetaObjectBuilder();

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

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