Sha256: 8faa16a55b33cf6d7389c8bd1efc184ca2d46b6fa44872a646bb1cd573ab19fd

Contents?: true

Size: 691 Bytes

Versions: 2

Compression:

Stored size: 691 Bytes

Contents

module OpenXml
  module Pptx
    module Properties
      class SlideLayoutId < OpenXml::Properties::ComplexProperty
        include OpenXml::ContainsProperties
        namespace :p
        tag :sldLayoutId

        attribute :id, expects: :integer, in_range: OpenXml::Pptx::MASTER_LAYOUT_ID_RANGE
        attribute :rid, displays_as: :id, namespace: :r, expects: :string, required: true

        property :extension_list

        def initialize(*_args)
          super
          generate_id
        end

        def generate_id
          self.id = OpenXml::Pptx::MASTER_LAYOUT_ID_RANGE.begin + object_id % OpenXml::Pptx::MASTER_LAYOUT_ID_RANGE.begin
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openxml-pptx-0.2.2 lib/openxml/pptx/properties/slide_layout_id.rb
openxml-pptx-0.2.0 lib/openxml/pptx/properties/slide_layout_id.rb