Hello,
I have a block of code which returns me a RubyArray back into C# code.
While I can get access to the strongly typed objects inside using
reflection, I was wondering if there was any way to get the data back
as a List ?
Example of the code at the moment:
RubyArray o = (RubyArray)
filters[1].GetFilteredOutTweets(tweets);
Console.WriteLine(o);
Console.WriteLine((o[0] as Tweet).User);
GetFilteredOutTweets returns an object as when it returned List
it was causing it to fail.
Make sense?
Thanks
Ben
RubyArray is IList, its items might be of arbitrary (different)
types.
You can certainly try to cast all of them to a single type:
var list = new List(array.Count);
foreach (Tweet item in array) {
list.Add(item);
}
Tomas
var list = array.Cast(); would be cleaner.
On Wed, Jun 2, 2010 at 5:47 PM, Tomas M.
<[email protected]
wrote:
While I can get access to the strongly typed objects inside using
GetFilteredOutTweets returns an object as when it returned List it
http://rubyforge.org/mailman/listinfo/ironruby-core
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core
–
“The explanation requiring the fewest assumptions is most likely to be
correct.”