public static object SetHashElement(RubyContext /*!*/ context, IDictionary <object, object> /*!*/ obj, object key, object value) { MutableString str = key as MutableString; if (str != null) { key = str.Duplicate(context, false, str.Clone()).Freeze(); } else { key = BaseSymbolDictionary.NullToObj(key); } return(obj[key] = value); }