Sha256: 5c2896ae033675f82bbcddc3c288d5127d16213ad9c0bf6916a4a6a58a20ddb1

Contents?: true

Size: 814 Bytes

Versions: 3

Compression:

Stored size: 814 Bytes

Contents

module OpenXml
  module Docx
    module Elements
      class AbsolutePositionTab < Element
        tag :ptab
        attribute :alignment, expects: :valid_ptab_alignment
        attribute :leader, expects: :valid_ptab_leader
        attribute :relativeTo, expects: :valid_ptab_relative_to

        VALID_PTAB_ALIGNMENTS = %i(center left right)
        VALID_PTAB_LEADERS = %i(dot hyphen middleDot none underscore)
        VALID_PTAB_RELATIVE_TOS = %i(indent margin)

      private

        def valid_ptab_alignment(value)
          valid_in? value, VALID_PTAB_ALIGNMENTS
        end

        def valid_ptab_leader(value)
          valid_in? value, VALID_PTAB_LEADERS
        end

        def valid_ptab_relative_to(value)
          valid_in? value, VALID_PTAB_RELATIVE_TOS
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
openxml-docx-0.9.0 lib/openxml/docx/elements/absolute_position_tab.rb
openxml-docx-0.8.0 lib/openxml/docx/elements/absolute_position_tab.rb
openxml-docx-0.8.0.beta1 lib/openxml/docx/elements/absolute_position_tab.rb