Class: DrawioDsl::XmlBuilder
- Inherits:
-
Object
- Object
- DrawioDsl::XmlBuilder
- Includes:
- KLog::Logging
- Defined in:
- lib/drawio_dsl/xml_builder.rb
Overview
Build the DrawioDsl XML file that is the basis of any draw-io diagrams.
Instance Attribute Summary collapse
-
#diagram ⇒ Object
readonly
Returns the value of attribute diagram.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(diagram) ⇒ XmlBuilder
constructor
A new instance of XmlBuilder.
Constructor Details
#initialize(diagram) ⇒ XmlBuilder
Returns a new instance of XmlBuilder.
10 11 12 |
# File 'lib/drawio_dsl/xml_builder.rb', line 10 def initialize(diagram) @diagram = diagram end |
Instance Attribute Details
#diagram ⇒ Object (readonly)
Returns the value of attribute diagram.
8 9 10 |
# File 'lib/drawio_dsl/xml_builder.rb', line 8 def diagram @diagram end |
Instance Method Details
#build ⇒ Object
14 15 16 17 18 19 |
# File 'lib/drawio_dsl/xml_builder.rb', line 14 def build xml_builder = Nokogiri::XML::Builder.new do |xml| build_diagram(xml) end xml_builder.to_xml.sub('<?xml version="1.0"?>', '').strip end |