Sha256: f074c6271e0a167c99ab09b846e3c6f731ad091a13abc5160b2024c0986c7d57

Contents?: true

Size: 389 Bytes

Versions: 8

Compression:

Stored size: 389 Bytes

Contents

module OpenXml
  module Docx
    module Properties
      class OnOffProperty < ValueProperty

        def ok_values
          [true, false, :on, :off] # :on and :off are from the Transitional Spec
        end

        def to_xml(xml)
          return xml["w"].public_send(tag) if value == true
          xml["w"].public_send(tag, "w:val" => value)
        end

      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
openxml-docx-0.11.5 lib/openxml/docx/properties/on_off_property.rb
openxml-docx-0.11.4 lib/openxml/docx/properties/on_off_property.rb
openxml-docx-0.11.3 lib/openxml/docx/properties/on_off_property.rb
openxml-docx-0.11.2 lib/openxml/docx/properties/on_off_property.rb
openxml-docx-0.11.1 lib/openxml/docx/properties/on_off_property.rb
openxml-docx-0.11.0 lib/openxml/docx/properties/on_off_property.rb
openxml-docx-0.11.0.rc lib/openxml/docx/properties/on_off_property.rb
openxml-docx-0.10.6 lib/openxml/docx/properties/on_off_property.rb