lib/thinreports/report/page.rb in thinreports-0.9.1 vs lib/thinreports/report/page.rb in thinreports-0.10.0
- old
+ new
@@ -1,10 +1,9 @@
-# coding: utf-8
+# frozen_string_literal: true
module Thinreports
module Report
-
class BlankPage
# @example
# 3.times do
# page = report.start_new_page
# puts page.no
@@ -49,12 +48,12 @@
# @param [Hash] options ({})
# @option options [Boolean] :count (true)
def initialize(report, layout, options = {})
super(options.key?(:count) ? options[:count] : true)
- @report = report
- @layout = layout
+ @report = report
+ @layout = layout
@finalized = false
initialize_manager(layout.format) do |f|
Core::Shape::Interface(self, f)
end
@@ -63,10 +62,11 @@
# @return [Boolean] (false)
def blank?
false
end
+ # rubocop:disable Metrics/AbcSize
def copy
new_page = self.class.new(report, layout, count: count?)
manager.shapes.each do |id, shape|
new_shape = shape.copy(new_page)
@@ -84,18 +84,17 @@
def finalize(options = {})
at = options[:at] || :create
# For list shapes.
if at == :create
- manager.lists.values.each {|list| list.manager.finalize }
+ manager.lists.values.each { |list| list.manager.finalize }
end
@finalized = true
end
def finalized?
@finalized
end
end
-
end
end