Sha256: 39253e7035c8a9cea620cf19720dfa4a0df27829253982f8e5a6676dc7017f33

Contents?: true

Size: 964 Bytes

Versions: 5

Compression:

Stored size: 964 Bytes

Contents

# frozen_string_literal: true

module Thinreports
  module BasicReport
    module Core
      module Shape
        module List
          class SectionFormat < Shape::Manager::Format
            config_reader :height
            config_reader relative_left: %w[translate x],
                          relative_top: %w[translate y]
            config_reader :style

            # For compatible 0.8.x format API
            config_checker true, display: %w[enabled]

            def initialize(*)
              super
              initialize_items(attributes['items'])
            end

            private

            def initialize_items(item_schemas)
              item_schemas.each do |item_schema|
                id, type = item_schema.values_at 'id', 'type'
                next if id.empty?

                shapes[id.to_sym] = Core::Shape::Format(type).new(item_schema)
              end
            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/list/section_format.rb
thinreports-0.14.1 lib/thinreports/basic_report/core/shape/list/section_format.rb
thinreports-0.14.0 lib/thinreports/basic_report/core/shape/list/section_format.rb
thinreports-0.13.1 lib/thinreports/basic_report/core/shape/list/section_format.rb
thinreports-0.13.0 lib/thinreports/basic_report/core/shape/list/section_format.rb