Sha256: 6339a589f686fb5ac37a2a818b87239dc06cfae1aa2ab99410e7cc235f158492

Contents?: true

Size: 685 Bytes

Versions: 7

Compression:

Stored size: 685 Bytes

Contents

# frozen_string_literal: true

module Thinreports
  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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
thinreports-0.12.1 lib/thinreports/core/shape/page_number/format.rb
thinreports-0.12.0 lib/thinreports/core/shape/page_number/format.rb
thinreports-0.11.0 lib/thinreports/core/shape/page_number/format.rb
thinreports-0.10.3 lib/thinreports/core/shape/page_number/format.rb
thinreports-0.10.2 lib/thinreports/core/shape/page_number/format.rb
thinreports-0.10.1 lib/thinreports/core/shape/page_number/format.rb
thinreports-0.10.0 lib/thinreports/core/shape/page_number/format.rb