Sha256: b6227851895ea81f14506d9aeb8e754f1ce448337cd2af1ea14846801df8e005
Contents?: true
Size: 571 Bytes
Versions: 14
Compression:
Stored size: 571 Bytes
Contents
module OpenXml module Docx module Properties class Language < ComplexProperty tag :lang with_namespace :w do attribute :bidi, expects: :valid_language attribute :east_asia, expects: :valid_language attribute :latin, expects: :valid_language, displays_as: :val end private def valid_language(value) message = "Invalid #{name}: must be a language code (RFC 4646)" raise ArgumentError, message unless value =~ /[a-z]{2}-[A-Z]{2}/ end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems