public static Hash /*!*/ Replace(RubyContext /*!*/ context, Hash /*!*/ self, [DefaultProtocol, NotNull] IDictionary <object, object> /*!*/ other) { if (Object.ReferenceEquals(self, other)) { self.RequireNotFrozen(); return(self); } Hash otherHash = other as Hash; if (otherHash != null) { self.DefaultValue = otherHash.DefaultValue; self.DefaultProc = otherHash.DefaultProc; } return(IDictionaryOps.ReplaceData(self, other)); }
public static object Shift(CallSiteStorage <Func <CallSite, Hash, object, object> > /*!*/ storage, Hash /*!*/ self) { self.RequireNotFrozen(); if (self.Count == 0) { var site = storage.GetCallSite("default", 1); return(site.Target(site, self, null)); } IEnumerator <KeyValuePair <object, object> > e = self.GetEnumerator(); e.MoveNext(); KeyValuePair <object, object> pair = e.Current; self.Remove(pair.Key); return(IDictionaryOps.MakeArray(pair)); }
public static Hash /*!*/ CompareByIdentity(Hash /*!*/ self) { self.RequireNotFrozen(); self.SetComparer(ReferenceEqualityComparer <object> .Instance); return(self); }
public static Hash /*!*/ Initialize(Hash /*!*/ self) { Assert.NotNull(self); self.RequireNotFrozen(); return(self); }
public static object Shift(Hash /*!*/ self) { self.RequireNotFrozen(); return(Shift((IDictionary <object, object>)self)); }
public static object RejectMutate([NotNull] BlockParam /*!*/ block, Hash /*!*/ self) { self.RequireNotFrozen(); return(RejectMutate(block, (IDictionary <object, object>)self)); }
public static Hash /*!*/ Replace(RubyContext /*!*/ context, Hash /*!*/ self, [DefaultProtocol, NotNull] IDictionary <object, object> /*!*/ other) { self.RequireNotFrozen(); return(IDictionaryOps.ReplaceData(self, other)); }
public static IDictionary <object, object> Rehash(Hash /*!*/ self) { self.RequireNotFrozen(); return(Rehash((IDictionary <object, object>)self)); }
public static object Update(BlockParam block, Hash /*!*/ self, [DefaultProtocol, NotNull] IDictionary <object, object> /*!*/ hash) { self.RequireNotFrozen(); return(Update(block, (IDictionary <object, object>)self, hash)); }
public static object Delete(BlockParam block, Hash /*!*/ self, object key) { self.RequireNotFrozen(); return(Delete(block, (IDictionary <object, object>)self, key)); }
public static IDictionary <object, object> /*!*/ Clear(Hash /*!*/ self) { self.RequireNotFrozen(); self.Clear(); return(self); }
public static object SetElement(RubyContext /*!*/ context, Hash /*!*/ self, object key, object value) { self.RequireNotFrozen(); return(RubyUtils.SetHashElement(context, self, key, value)); }