Module: Musa::MusicXML::Builder::Internal::Helper::ToXML Private
- Included in:
- Attributes, Backup, Clef, Forward, Musa::MusicXML::Builder::Internal::Harmonic, Key, Measure, Part, Time, ScorePartwise
- Defined in:
- lib/musa-dsl/musicxml/builder/helper.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Mixin for XML serialization capability.
Provides the public to_xml interface that handles IO and indentation
setup, delegating to the private _to_xml method for actual XML generation.
Usage
Classes including this module must implement _to_xml(io, indent:, tabs:).
Instance Method Summary collapse
-
#to_xml(io = nil, indent: nil) ⇒ IO, StringIO
private
Converts the object to MusicXML format.
Instance Method Details
#to_xml(io = nil, indent: nil) ⇒ IO, StringIO
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Converts the object to MusicXML format.
This method sets up the IO stream and indentation, then delegates to
the private _to_xml method for actual XML generation.
160 161 162 163 164 165 166 167 168 169 |
# File 'lib/musa-dsl/musicxml/builder/helper.rb', line 160 def to_xml(io = nil, indent: nil) io ||= StringIO.new indent ||= 0 tabs = "\t" * indent _to_xml(io, indent: indent, tabs: tabs) io end |