Class: OpenXml::Part

Inherits:
Object
  • Object
show all
Defined in:
lib/openxml/part.rb

Instance Method Summary collapse

Instance Method Details

#build_standalone_xml(&block) ⇒ Object



10
11
12
# File 'lib/openxml/part.rb', line 10

def build_standalone_xml(&block)
  build_xml(standalone: :yes, &block)
end

#build_xml(options = {}) ⇒ Object



6
7
8
# File 'lib/openxml/part.rb', line 6

def build_xml(options={})
  OpenXml::Builder.new(options) { |xml| yield xml }
end

#readObject Also known as: content



14
15
16
# File 'lib/openxml/part.rb', line 14

def read
  to_xml.to_s
end

#to_xmlObject

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/openxml/part.rb', line 19

def to_xml
  raise NotImplementedError, "#{self.class} needs to implements to_xml"
end