Class: XmlLaborabrechnungsdaten::Document
- Inherits:
-
Object
- Object
- XmlLaborabrechnungsdaten::Document
- Includes:
- MemberContainer
- Defined in:
- lib/xml_laborabrechnungsdaten.rb
Constant Summary collapse
- DEFAULT_SCHEMA_LOCATION =
"Laborabrechnungsdaten_(KZBV-VDZI-VDDS)_(V4-5).xsd"- UTF8_BOM =
"\xEF\xBB\xBF"
Instance Attribute Summary collapse
-
#bom ⇒ Boolean
Prepend UTF-8 BOM (EF BB BF); default false.
-
#line_endings ⇒ Symbol
:lf (default) or :crlf for Windows compatibility.
-
#rechnung ⇒ Rechnung
The invoice details.
-
#schema_location ⇒ String?
Xsi:noNamespaceSchemaLocation value; set to nil to omit the attribute.
-
#version ⇒ String
Version of the XML schema.
Instance Method Summary collapse
Methods included from MemberContainer
#[], #[]=, included, #initialize, #members
Instance Attribute Details
#bom ⇒ Boolean
Returns prepend UTF-8 BOM (EF BB BF); default false.
34 |
# File 'lib/xml_laborabrechnungsdaten.rb', line 34 member :bom, type: [TrueClass, FalseClass], default: false |
#line_endings ⇒ Symbol
Returns :lf (default) or :crlf for Windows compatibility.
30 |
# File 'lib/xml_laborabrechnungsdaten.rb', line 30 member :line_endings, type: Symbol, default: :lf |
#rechnung ⇒ Rechnung
Returns The invoice details.
22 |
# File 'lib/xml_laborabrechnungsdaten.rb', line 22 member :rechnung, type: Rechnung |
#schema_location ⇒ String?
Returns xsi:noNamespaceSchemaLocation value; set to nil to omit the attribute.
26 |
# File 'lib/xml_laborabrechnungsdaten.rb', line 26 member :schema_location, type: String, default: DEFAULT_SCHEMA_LOCATION |
#version ⇒ String
Returns Version of the XML schema.
16 |
# File 'lib/xml_laborabrechnungsdaten.rb', line 16 member :version, type: String, default: "4.5" |
Instance Method Details
#to_xml(indent: 2, target: "") ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/xml_laborabrechnungsdaten.rb', line 38 def to_xml(indent: 2, target: "") xml = Builder::XmlMarkup.new(indent: indent, target: target) xml.instruct! :xml, version: "1.0", encoding: "UTF-8" root_attrs = {} root_attrs["xsi:noNamespaceSchemaLocation"] = schema_location if schema_location root_attrs["xmlns:xsi"] = "http://www.w3.org/2001/XMLSchema-instance" root_attrs["Version"] = version xml.Laborabrechnung(root_attrs) do rechnung&.to_xml(xml) end target.gsub!("\n", "\r\n") if line_endings == :crlf bom ? UTF8_BOM + target : target end |