using System.Collections;

namespace Beam {
    public class StringEnumerable : IEnumerable<string> {
        private StringEnumerable(IEnumerator<string> enumerator) {
            Enumerator = enumerator;
        }

        public IEnumerator<string> Enumerator { get; }

        public static StringEnumerable FromGenerator(IEnumerator<string> generator)
            => new StringEnumerable(generator);

        public IEnumerator<string> GetEnumerator() {
            return Enumerator;
        }

        IEnumerator IEnumerable.GetEnumerator() {
            return Enumerator;
        }
    }
}
