Lazy stream implementation for Ruby