title: Yielding inside a block
body: <p>I've been given this class which includes the Enumerable module:</p>
  
  <pre><code>class Team 
    include Enumerable # LOTS of functionality
  
    attr_accessor :name, :players 
    def initialize (name) 
      @name = name 
      @players = [] 
    end 
    def add_players (*players) # splat 
      @players += players
    end 
    def to_s 
      "#{@name} team: #{@players.join(", ")}" 
    end 
    def each 
      @players.each { |player| yield player }
    end 
  end 
  </code></pre>
  
  <p>I know that <em>yield</em> is used to be able to call a block inside a method when a block is passed as a method argument. What then does the yield do inside this block?</p>