[Ironruby-core] Creating RubySymbols in C#

Rob Britton rob.s.brit at gmail.com
Thu Jun 23 11:45:48 EDT 2011


Hello,

I'm attempting to write a method in C# that is called by IronRuby to
speed up an existing script, and I call it like this:

  foo :limit => 5, :offset => 10

How would I go about accessing these objects from C#? I'm trying
something like this:

void foo(Hash options){
  int limit = (int)options[new RubySymbol("limit")];
  ...
}

However this doesn't work since RubySymbols constructor is private.
How would I go about getting the objects within the hash?

Thanks,
Rob


More information about the Ironruby-core mailing list