Class: OpenXml::Docx::Properties::PhoneticGuideLanguage

Inherits:
ValueProperty show all
Defined in:
lib/openxml/docx/properties/phonetic_guide_language.rb

Instance Attribute Summary

Attributes inherited from ValueProperty

#value

Attributes inherited from BaseProperty

#value

Instance Method Summary collapse

Methods inherited from ValueProperty

#initialize, #render?, #to_xml

Methods inherited from BaseProperty

#default_name, #default_namespace, #default_tag, #initialize, name, #name, namespace, #namespace, #render?, tag, #tag, tag_is_one_of

Constructor Details

This class inherits a constructor from OpenXml::Docx::Properties::ValueProperty

Instance Method Details

#invalid_messageObject



12
13
14
# File 'lib/openxml/docx/properties/phonetic_guide_language.rb', line 12

def invalid_message
  "Invalid #{name}: must be a language code (RFC 4646)"
end

#valid?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/openxml/docx/properties/phonetic_guide_language.rb', line 8

def valid?
  value =~ /[a-z]{2}-[A-Z]{2}/
end