Class: Rocx::Parts::BasePart
- Inherits:
-
Object
- Object
- Rocx::Parts::BasePart
show all
- Includes:
- Nokogiri
- Defined in:
- lib/rocx/parts/base_part.rb
Instance Method Summary
collapse
Instance Method Details
#build_standalone_xml ⇒ Object
12
13
14
15
|
# File 'lib/rocx/parts/base_part.rb', line 12
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
8
9
10
|
# File 'lib/rocx/parts/base_part.rb', line 8
def build_xml
XML::Builder.new(encoding: "utf-8") { |xml| yield xml }.to_xml
end
|
#read ⇒ Object
17
18
19
|
# File 'lib/rocx/parts/base_part.rb', line 17
def read
strip_whitespace to_xml
end
|
#to_xml ⇒ Object
21
22
23
|
# File 'lib/rocx/parts/base_part.rb', line 21
def to_xml
raise NotImplementedError
end
|