lib/openxml/docx/properties/page_numbering.rb in openxml-docx-0.9.0 vs lib/openxml/docx/properties/page_numbering.rb in openxml-docx-0.10.0

- old
+ new

@@ -2,87 +2,79 @@ module Docx module Properties class PageNumbering < ComplexProperty tag :pgNumType - attribute :chapter_separator, expects: :valid_chapter_separator, displays_as: :chapSep - attribute :chapter_style, expects: :integer, displays_as: :chapStyle - attribute :format, expects: :valid_page_number_format, displays_as: :fmt - attribute :start, expects: :integer + with_namespace :w do + attribute :chapter_separator, one_of: %i(colon emDash enDash hyphen period), displays_as: :chapSep + attribute :chapter_style, expects: :integer, displays_as: :chapStyle + attribute :start, expects: :integer + attribute :format, displays_as: :fmt, one_of: %i(aiueo + aiueoFullWidth + arabicAbjad + arabicAlpha + bahtText + bullet + cardinalText + chicago + chineseCounting + chineseCountingThousand + chineseLegalSimplified + chosung + custom + decimal + decimalEnclosedCircle + decimalEnclosedCircleChinese + decimalEnclosedFullstop + decimalEnclosedParen + decimalFullWidth + decimalHalfWidth + decimalZero + dollarText + ganada + hebrew1 + hebrew2 + hex + hindiConsonants + hindiCounting + hindiNumbers + hindiVowels + ideographDigital + ideographEnclosedCircle + taiwaneseDigital + ideographLegalTraditional + ideographTraditional + ideographZodiac + ideographZodiacTraditional + iroha + irohaFullWidth + japaneseCounting + japaneseDigitalTenThousand + japaneseLegal + koreanCounting + koreanDigital + koreanDigital2 + koreanLegal + lowerLetter + lowerRoman + none + numberInDash + ordinal + ordinalText + russianLower + russianUpper + taiwaneseCounting + taiwaneseCountingThousand + thaiCounting + thaiLetters + thaiNumbers + upperLetter + upperRoman + vietnameseCounting) - VALID_CHAPTER_SEPARATORS = %i(colon emDash enDash hyphen period) - VALID_PAGE_NUMBER_FORMATS = %i(aiueo - aiueoFullWidth - arabicAbjad - arabicAlpha - bahtText - bullet - cardinalText - chicago - chineseCounting - chineseCountingThousand - chineseLegalSimplified - chosung - custom - decimal - decimalEnclosedCircle - decimalEnclosedCircleChinese - decimalEnclosedFullstop - decimalEnclosedParen - decimalFullWidth - decimalHalfWidth - decimalZero - dollarText - ganada - hebrew1 - hebrew2 - hex - hindiConsonants - hindiCounting - hindiNumbers - hindiVowels - ideographDigital - ideographEnclosedCircle - taiwaneseDigital - ideographLegalTraditional - ideographTraditional - ideographZodiac - ideographZodiacTraditional - iroha - irohaFullWidth - japaneseCounting - japaneseDigitalTenThousand - japaneseLegal - koreanCounting - koreanDigital - koreanDigital2 - koreanLegal - lowerLetter - lowerRoman - none - numberInDash - ordinal - ordinalText - russianLower - russianUpper - taiwaneseCounting - taiwaneseCountingThousand - thaiCounting - thaiLetters - thaiNumbers - upperLetter - upperRoman - vietnameseCounting) - private - - def valid_chapter_separator(value) - valid_in? value, VALID_CHAPTER_SEPARATORS end - def valid_page_number_format(value) - valid_in? value, VALID_PAGE_NUMBER_FORMATS - end end end end end