---
title: "I Have Written Ruby for Years and Just Discovered Enumerator#feed"
url: https://daily.dev/posts/i-have-written-ruby-for-years-and-just-discovered-enumerator-feed-8qtzkqrwq
source_url: https://rubystacknews.com/2026/06/15/i-have-written-ruby-for-years-and-just-discovered-enumeratorfeed
type: article
source: "Ruby Flow"
published: 2026-06-16T08:42:11.562Z
updated: 2026-06-19T08:20:01.060Z
tags: ["ruby"]
reading_time: 3
upvotes: 4
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I Have Written Ruby for Years and Just Discovered Enumerator#feed

**[Ruby Flow](https://daily.dev/sources/rubyflow)** · 3 min read · 4 upvotes · 0 comments

## Summary

Ruby's Enumerator#feed is a little-known method that enables bidirectional communication between an Enumerator and its caller. While most developers use Enumerators as one-way value streams, feed allows the caller to inject a value that becomes the return value of yield inside the Enumerator, effectively creating coroutine-like suspension and resumption with state. Practical examples show how to build interactive workflows without instance variables or external state. Though rarely needed in typical Rails apps, it's useful for DSLs, parsers, custom interpreters, and experimental concurrency systems.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://rubystacknews.com/2026/06/15/i-have-written-ruby-for-years-and-just-discovered-enumeratorfeed>

## Similar posts on daily.dev

- [Ruby Inject and Ruby Reduce: Aliases for Powerful Enumeration](https://daily.dev/posts/ruby-inject-and-ruby-reduce-aliases-for-powerful-enumeration-hjgko6cdh) · RUBYLAND · 0 upvotes · 0 comments
- [RubyFlow](https://daily.dev/posts/rubyflow-8fihq4lel) · Ruby Flow · 0 upvotes · 0 comments
- [Some Smalltalk about Ruby Loops](https://daily.dev/posts/some-smalltalk-about-ruby-loops-gv2dmqisd) · Lobsters · 0 upvotes · 0 comments

---

Tags: [#ruby](https://daily.dev/tags/ruby)

[View this post on daily.dev](https://daily.dev/posts/i-have-written-ruby-for-years-and-just-discovered-enumerator-feed-8qtzkqrwq)
