Forum: IronRuby IronRuby hosting - executing C# method

Ae47387d8e20eb904395c87e0d892962?d=identicon&s=25 Konstantin Kos (k0st1x)
on 2012-11-20 21:25
Hi,
I have some issue with hosting IronRuby in C# application.

I've created Ruby ScriptEngine, created ScriptScope with delegate in it:
> C#
> scope.SetVariable("func", new Action<object>(MyMethod));

but can't execute "func" from script

> Ruby
> func("argument")
fails with ArgumentException "wrong number of arguments (1 for 0)"

but can run it by calling "invoke":
> Ruby
> func.invoke("argument")

is it possible to execute Delegate like normal ruby function?
D7aaf307f96bbdf5ff39be313fe581be?d=identicon&s=25 Orion Edwards (Guest)
on 2012-11-20 21:50
(Received via mailing list)
_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core
Ae47387d8e20eb904395c87e0d892962?d=identicon&s=25 Konstantin Kos (k0st1x)
on 2012-11-21 11:57
Orion Edwards wrote in post #1085558:
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core@rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core

???
This topic is locked and can not be replied to.