Class: OpenXml::Part
- Inherits:
-
Object
show all
- Includes:
- Nokogiri
- Defined in:
- lib/open_xml/part.rb
Instance Method Summary
collapse
Instance Method Details
#build_standalone_xml ⇒ Object
11
12
13
14
|
# File 'lib/open_xml/part.rb', line 11
def build_standalone_xml
xml = Nokogiri::XML("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>")
XML::Builder.with(xml) { |xml| yield xml }.to_xml
end
|
#build_xml ⇒ Object
7
8
9
|
# File 'lib/open_xml/part.rb', line 7
def build_xml
XML::Builder.new(encoding: "utf-8") { |xml| yield xml }.to_xml
end
|
#read ⇒ Object
Also known as:
content
16
17
18
|
# File 'lib/open_xml/part.rb', line 16
def read
strip_whitespace to_xml
end
|
#to_xml ⇒ Object
21
22
23
|
# File 'lib/open_xml/part.rb', line 21
def to_xml
raise NotImplementedError
end
|