Class: Thinreports::BasicReport::Report::Page
Instance Attribute Summary collapse
#manager
Attributes inherited from BlankPage
#no
Instance Method Summary
collapse
#[], #[]=, #item, #item_exists?, #list, #values
Methods included from Utils
#blank_value?, #call_block_in, #deep_copy, included
Methods inherited from BlankPage
#count?
Constructor Details
#initialize(report, layout, options = {}) ⇒ Page
Returns a new instance of Page.
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/thinreports/basic_report/report/page.rb', line 51
def initialize(report, layout, options = {})
super(options.key?(:count) ? options[:count] : true)
@report = report
@layout = layout
@finalized = false
initialize_manager(layout.format) do |f|
Core::Shape::Interface(self, f)
end
end
|
Instance Attribute Details
45
46
47
|
# File 'lib/thinreports/basic_report/report/page.rb', line 45
def layout
@layout
end
|
42
43
44
|
# File 'lib/thinreports/basic_report/report/page.rb', line 42
def report
@report
end
|
Instance Method Details
#blank? ⇒ Boolean
64
65
66
|
# File 'lib/thinreports/basic_report/report/page.rb', line 64
def blank?
false
end
|
#copy ⇒ Object
68
69
70
71
72
73
74
75
76
77
78
|
# File 'lib/thinreports/basic_report/report/page.rb', line 68
def copy
new_page = self.class.new(report, layout, count: count?)
manager.shapes.each do |id, shape|
new_shape = shape.copy(new_page)
new_page.manager.shapes[id] = new_shape
new_page.manager.lists[id] = new_shape if new_shape.internal.type_of?(Core::Shape::List::TYPE_NAME)
end
new_page
end
|
#finalize(options = {}) ⇒ Object
82
83
84
85
86
87
88
89
|
# File 'lib/thinreports/basic_report/report/page.rb', line 82
def finalize(options = {})
at = options[:at] || :create
manager.lists.each_value { |list| list.manager.finalize } if at == :create
@finalized = true
end
|
#finalized? ⇒ Boolean
91
92
93
|
# File 'lib/thinreports/basic_report/report/page.rb', line 91
def finalized?
@finalized
end
|