Sha256: a39721a786875be14aef05e9ce5b867f0821d6b76cd2c3335c3754c4791fb586

Contents?: true

Size: 756 Bytes

Versions: 5

Compression:

Stored size: 756 Bytes

Contents

# frozen_string_literal: true

module Thinreports
  module BasicReport
    module Core
      module Shape
        module PageNumber
          class Format < Basic::Format
            config_reader :target
            config_reader default_format: %w[format]

            # For saving compatible 0.8.x format API
            config_reader overflow: %w[style overflow]

            def id
              @id ||= blank_value?(read('id')) ? self.class.next_default_id : read('id')
            end

            def for_report?
              blank_value?(target)
            end

            def self.next_default_id
              @id_counter ||= 0
              "__pageno#{@id_counter += 1}"
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
thinreports-0.14.2 lib/thinreports/basic_report/core/shape/page_number/format.rb
thinreports-0.14.1 lib/thinreports/basic_report/core/shape/page_number/format.rb
thinreports-0.14.0 lib/thinreports/basic_report/core/shape/page_number/format.rb
thinreports-0.13.1 lib/thinreports/basic_report/core/shape/page_number/format.rb
thinreports-0.13.0 lib/thinreports/basic_report/core/shape/page_number/format.rb