Sha256: 2d8d6dc0ec891aab8e432f6385e247215223b202ec727179b6519a0f5f4d19c3

Contents?: true

Size: 550 Bytes

Versions: 14

Compression:

Stored size: 550 Bytes

Contents

module OpenXml
  module Docx
    module Properties
      class HeaderReference < ComplexProperty
        namespace :w

        attribute :id, expects: :string, namespace: :r
        attribute :type, expects: :valid_header_type, namespace: :w

      private

        def valid_header_type(value)
          ok_values = %i(default even first)
          message = "Invalid header type (#{value}). Allowed types are: #{ok_values.join(", ")}."
          raise ArgumentError, message unless ok_values.include? value
        end

      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
openxml-docx-0.11.5 lib/openxml/docx/properties/header_reference.rb
openxml-docx-0.11.4 lib/openxml/docx/properties/header_reference.rb
openxml-docx-0.11.3 lib/openxml/docx/properties/header_reference.rb
openxml-docx-0.11.2 lib/openxml/docx/properties/header_reference.rb
openxml-docx-0.11.1 lib/openxml/docx/properties/header_reference.rb
openxml-docx-0.11.0 lib/openxml/docx/properties/header_reference.rb
openxml-docx-0.11.0.rc lib/openxml/docx/properties/header_reference.rb
openxml-docx-0.10.6 lib/openxml/docx/properties/header_reference.rb
openxml-docx-0.10.5 lib/openxml/docx/properties/header_reference.rb
openxml-docx-0.10.4 lib/openxml/docx/properties/header_reference.rb
openxml-docx-0.10.3 lib/openxml/docx/properties/header_reference.rb
openxml-docx-0.10.2 lib/openxml/docx/properties/header_reference.rb
openxml-docx-0.10.1 lib/openxml/docx/properties/header_reference.rb
openxml-docx-0.10.0 lib/openxml/docx/properties/header_reference.rb