lib/thinreports/report/internal.rb in thinreports-0.9.1 vs lib/thinreports/report/internal.rb in thinreports-0.10.0
- old
+ new
@@ -1,10 +1,9 @@
-# coding: utf-8
+# frozen_string_literal: true
module Thinreports
module Report
-
class Internal
attr_reader :pages
attr_reader :page
attr_reader :page_count
attr_reader :default_layout
@@ -17,13 +16,13 @@
def initialize(report, options)
@report = report
@default_layout = options[:layout] ? init_layout(options[:layout]) : nil
@layout_registry = {}
- @finalized = false
- @pages = []
- @page = nil
+ @finalized = false
+ @pages = []
+ @page = nil
@page_count = 0
@page_create_handler = nil
end
@@ -50,14 +49,14 @@
finalize_current_page(at: :copy)
insert_page(page.copy)
end
def finalize
- unless finalized?
- finalize_current_page
- @finalized = true
- end
+ return if finalized?
+
+ finalize_current_page
+ @finalized = true
end
def finalized?
@finalized
end
@@ -77,11 +76,11 @@
@default_layout = layout unless @default_layout
layout
end
- private
+ private
def insert_page(new_page)
@pages << new_page
if new_page.count?
@@ -100,8 +99,7 @@
def init_layout(filename, id = nil)
Thinreports::Layout.new(filename, id: id)
end
end
-
end
end