lib/thinreports/report/base.rb in thinreports-0.8.2 vs lib/thinreports/report/base.rb in thinreports-0.9.0

- old
+ new

@@ -106,18 +106,16 @@ # @param [String] layout filename of layout file # @param [Hash] options # @option options [Boolean] :default (true) # @option options [Symbol] :id (nil) - # @yield [config] - # @yieldparam [Thinreports::Layout::Configuration] config # @example # report.use_layout '/path/to/default_layout.tlf' # Default layout # report.use_layout '/path/to/default_layout.tlf', default: true # report.use_layout '/path/to/other_layout', id: :other_layout - def use_layout(layout, options = {}, &block) - internal.register_layout(layout, options, &block) + def use_layout(layout, options = {}) + internal.register_layout(layout, options) end # @example # page = report.start_new_page # @@ -140,11 +138,11 @@ def start_new_page(options = {}, &block) layout = internal.load_layout(options.delete(:layout)) raise Thinreports::Errors::NoRegisteredLayoutFound unless layout - page = internal.add_page(layout.new_page(self, options)) + page = internal.add_page(Report::Page.new(self, layout, options)) call_block_in(page, &block) end # @param [Hash] options # @option options [Boolean] :count (true) @@ -187,21 +185,9 @@ # @see Thinreports::Core::Shape::Manager::Target#list def list(id = nil, &block) start_new_page if page.nil? || page.finalized? page.list(id, &block) - end - - # @return [Thinreports::Report::Events] - # @deprecated - # `Report::Base#events` will be removed in the next major version. - # Please use #on_page_create callbacks instead. - # See also https://github.com/thinreports/thinreports-generator/blob/master/examples/report_callbacks/report_callbacks.rb. - def events - warn '[DEPRECATION] `Report::Base#events` will be removed in the next major version. ' + - 'Please use #on_page_create callbacks instead. ' + - 'See also https://github.com/thinreports/thinreports-generator/blob/master/examples/report_callbacks/report_callbacks.rb.' - internal.events end def_delegators :internal, :finalize, :finalized? end