Changeset 1280

Show
Ignore:
Timestamp:
02/19/08 07:25:24 (9 months ago)
Author:
brian
Message:

Move delete(:data) so as to be closer to old structure

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ruport/branches/brian/exp-renderer-instance/lib/ruport/renderer.rb

    r1278 r1280  
    417417  # to the file. Return the results of formatter.output 
    418418  # 
    419   # If a block is given, yield the renderer to it after the formatter 
    420   # has been created (for backwards compatibility) 
     419  # If a block is given, yield the formatter to it before running the report. 
    421420  def as(format, add_options={}) 
    422421    with_formatter(format, add_options) do |formatter| 
     
    474473    formatter.options = @options.dup 
    475474    add_options.each {|k,v| formatter.options.send("#{k}=",v) } 
     475    d = formatter.options.to_hash.delete(:data) 
     476    formatter.data = d if d 
    476477 
    477478    if self.class.const_defined? :Helpers 
     
    489490  # The formatter must have been created before this method is called 
    490491  def _run_ 
    491     d = formatter.options.to_hash.delete(:data) 
    492     formatter.data = d if d 
    493  
    494492    if formatter.respond_to?(:apply_template) && formatter.options.template != false 
    495493      formatter.apply_template if formatter.options.template ||