Why not use the ModuleClass directly from C#?
For example, if your ruby file looks like that:
class ModuleClass def getObjectHash(hashString)return
hashString.to_s.to_clr_string endend
Then in C# you'll use it as follows:
var engine = IronRuby.Ruby.CreateEngine(); var
Thanks for your answer, Eduardo.
I've done it as you adviced:
hashString = ModuleClass.GetObjectHash(testObject).to_s.to_clr_string
# in IronRuby code
and tried to call it in C#:
string netString;
engine.ExecuteFile(path).TryGetVariable("hashString", out netString);
Console.WriteLine(netString)
Hi Alexander,
did you try to convert the strings in the hash (which are a special type
of string called mutablestring) to a System::String.
I usually use:
a = "This is A String"
print a.class # => String
print a.to_clr_string # => System::String (which is the standard .net
string type)
I w