class OpenXml::Docx::Properties::ValueProperty

Attributes

value[R]

Public Class Methods

new(value) click to toggle source
# File lib/openxml/docx/properties/value_property.rb, line 7
def initialize(value)
  @value = value
  raise ArgumentError, invalid_message unless valid?
end

Public Instance Methods

invalid_message() click to toggle source
# File lib/openxml/docx/properties/value_property.rb, line 16
def invalid_message
  "Invalid value for #{name}; acceptable values are #{ok_values.join(", ")} (provided: #{value.inspect})"
end
render?() click to toggle source
# File lib/openxml/docx/properties/value_property.rb, line 20
def render?
  !value.nil?
end
to_xml(xml) click to toggle source
# File lib/openxml/docx/properties/value_property.rb, line 24
def to_xml(xml)
  xml["w"].public_send(tag, "w:val" => value)
end
valid?() click to toggle source
# File lib/openxml/docx/properties/value_property.rb, line 12
def valid?
  ok_values.member? value
end