class Thinreports::Report::Page

Attributes

layout[R]

@return [Thinreports::Layout::Base]

report[R]

@return [Thinreports::Report::Base]

Public Class Methods

new(report, layout, options = {}) click to toggle source

@param [Thinreports::Report::Base] report @param [Thinreports::Layout::Base] layout @param [Hash] options ({}) @option options [Boolean] :count (true)

Calls superclass method Thinreports::Report::BlankPage::new
# File lib/thinreports/report/page.rb, line 50
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

Public Instance Methods

blank?() click to toggle source

@return [Boolean] (false)

# File lib/thinreports/report/page.rb, line 63
def blank?
  false
end
copy() click to toggle source
# File lib/thinreports/report/page.rb, line 67
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 = {}) click to toggle source

@param [Hash] options @option options [:create, :copy] :at (:create)

# File lib/thinreports/report/page.rb, line 81
def finalize(options = {})
  at = options[:at] || :create

  # For list shapes.
  manager.lists.each_value { |list| list.manager.finalize } if at == :create

  @finalized = true
end
finalized?() click to toggle source
# File lib/thinreports/report/page.rb, line 90
def finalized?
  @finalized
end