Re: [Ironruby-core] Getting variable form IronRuby

2012-08-02 Thread Shay Friedman
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

Re: [Ironruby-core] Getting variable form IronRuby

2012-07-27 Thread Alexander Ranger
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)

Re: [Ironruby-core] Getting variable form IronRuby

2012-07-27 Thread Eduardo Blumenfeld
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