title: Eloquent Ruby - saving code blocks to execute later example
body: <p>In Eloquent Ruby there's a code example I don't understand.</p>
  
  <pre><code>class Document
    attr_accessor :save_listener
  
    # most of the class omitted...
  
    def on_save( &amp;block )
      @save_listener = block
    end
  
    def save( path )
      File.open( path, 'w' ) { |f| f.print( @contents ) }
      @save_listener.call( self, path ) if @save_listener
    end
  end
  
  # usage
  my_doc = Document.new( 'block based example', 'russ', '' )
  my_doc.on_save do |doc|
    puts "Hey, I've been saved!"
  end
  </code></pre>
  
  <p>Why is it that <code>@save_listener.call( self, path )</code> takes TWO arguments? The block that's saved looks like it only has ONE parameter <code>|doc|</code>. Is this a typo in the book or is there something here I'm missing?</p>
  
  <p>I even tried typing this code in and executing it and I found I can add as many parameters as I want and there wont be any errors. But I still don't get why there are TWO parameters in this example. </p>