title: What does class_eval <<-"end_eval", __FILE__, __LINE__ mean in Ruby?
body: <p>I'm learning how to use class_eval in modules (I'm somewhat familiar with class_eval) and came across <a href="http://github.com/jamesgolick/resource_controller/blob/master/lib/resource_controller/accessors.rb" rel="noreferrer">this helpful class in resource_controller</a>.  In there they have things like this:</p>
  
  <pre><code>class_eval &lt;&lt;-"end_eval", __FILE__, __LINE__
  
    def #{block_accessor}(*args, &amp;block)
      unless args.empty? &amp;&amp; block.nil?
        args.push block if block_given?
        @#{block_accessor} = [args].flatten
      end
  
      @#{block_accessor}
    end
  
  end_eval
  </code></pre>
  
  <p>What does <code>__FILE__</code> and <code>__LINE__</code> do in that context?  I know <code>__FILE__</code> references the current file, but what does that whole thing do exactly?  Don't really know how to search for that :).</p>