title: Making a Ruby block return an array?
body: <p>I've made a small DSL-like program for adding drinks to an array. It's a pretty basic example for using <code>instance_eval</code> and <code>&amp;block</code> to create a quick program.</p>
  
  <p>Here's the program:</p>
  
  <pre><code>class Drinks
    def initialize(&amp;block) # Initialize drinks
      @drinks = []
      instance_eval &amp;block
    end
  
    def drink(d)
      @drinks &lt;&lt; d
    end # Add drink
  
    def all_drinks
      puts @drinks
    end
  
  end
  
  add_drinks = Drinks.new do
    drink "water"
    drink "soda"
    drink "juice"
  end
  
  add_drinks.all_drinks
  </code></pre>
  
  <p>The plan is to make <code>add_drinks</code> auto-return itself so you don't have to use <code>add_drinks.all_drinks</code>. Would this be possible? Thanks.</p>