public static object EachPair(BlockParam block, RubyStruct/*!*/ self) { if (block == null && self.ItemCount > 0) { throw RubyExceptions.NoBlockGiven(); } var context = self.ImmediateClass.Context; foreach (KeyValuePair<string, object> entry in self.GetItems()) { object result; if (block.Yield(context.EncodeIdentifier(entry.Key), entry.Value, out result)) { return result; } } return self; }
public static object EachPair(BlockParam block, RubyStruct /*!*/ self) { if (block == null && self.ItemCount > 0) { throw RubyExceptions.NoBlockGiven(); } foreach (KeyValuePair <string, object> entry in self.GetItems()) { object result; if (block.Yield(SymbolTable.StringToId(entry.Key), entry.Value, out result)) { return(result); } } return(self); }
public static object EachPair(BlockParam block, RubyStruct /*!*/ self) { if (block == null && self.ItemCount > 0) { throw RubyExceptions.NoBlockGiven(); } var context = self.ImmediateClass.Context; foreach (KeyValuePair <string, object> entry in self.GetItems()) { object result; if (block.Yield(context.EncodeIdentifier(entry.Key), entry.Value, out result)) { return(result); } } return(self); }
public static object EachPair(BlockParam block, RubyStruct/*!*/ self) { if (block == null && self.ItemCount > 0) { throw RubyExceptions.NoBlockGiven(); } foreach (KeyValuePair<string, object> entry in self.GetItems()) { object result; if (block.Yield(SymbolTable.StringToId(entry.Key), entry.Value, out result)) { return result; } } return self; }