Executing the below code gives me the following exception on the last line:
InvalidOperationException: "unbound variable: value"
var rubyRuntime = Ruby.CreateRuntime();
rubyRuntime.UseFile("HandleMoveRequested.rb");
var engine = rubyRuntime.GetEngine("rb");
dynamic ruby = engine.Runtime.Globals;
var handler = ruby.HandleMoveRequested.@new();
dynamic msg = new ExpandoObject();
msg.x = 1;
msg.y = 2;
handler.handle(msg);
The contents of HandleMoveRequested.rb are:
class HandleMoveRequested
def handle(msg)
System::Console.WriteLine msg.x
System::Console.WriteLine msg.y
end
end
Basically I just want to be able to pass a fully dynamic object into that Ruby object's "handle" method and have it be able to access the "x" and "y" properties on that object. Am I barking up the wrong tree?