Class: OpenXml::Docx::Properties::Expansion
- Inherits:
-
ValueProperty
- Object
- BaseProperty
- ValueProperty
- OpenXml::Docx::Properties::Expansion
- Defined in:
- lib/openxml/docx/properties/expansion.rb
Instance Attribute Summary
Attributes inherited from ValueProperty
Attributes inherited from BaseProperty
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_message ⇒ Object
13 14 15 |
# File 'lib/openxml/docx/properties/expansion.rb', line 13 def "Invalid #{name}: value must be a percentage greater than 0 or less than 601" end |
#valid? ⇒ Boolean
7 8 9 10 11 |
# File 'lib/openxml/docx/properties/expansion.rb', line 7 def valid? return false unless value =~ /(\d{1,3})%/ percentage = $1.to_i percentage >= 1 && percentage <= 600 end |