GetItems() 공개 메소드

public GetItems ( ) : object>>.IEnumerable
리턴 object>>.IEnumerable
예제 #1
0
파일: StructOps.cs 프로젝트: TerabyteX/main
        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;
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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;
        }