Class: Saxon::Serializer
- Inherits:
-
Object
- Object
- Saxon::Serializer
- Defined in:
- lib/saxon/serializer.rb
Overview
Serialize XDM objects.
Defined Under Namespace
Classes: OutputProperties
Instance Method Summary collapse
-
#initialize(s9_serializer) ⇒ Serializer
constructor
private
A new instance of Serializer.
-
#output_property ⇒ Saxon::Serializer::OutputProperties
Hash-like access to the Output Properties.
- #serialize(xdm_value, io_or_path = nil) ⇒ Object
-
#to_java ⇒ Saxon::S9API::Serializer
The underlying Saxon Serializer object.
Constructor Details
#initialize(s9_serializer) ⇒ Serializer
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.
Returns a new instance of Serializer.
79 80 81 |
# File 'lib/saxon/serializer.rb', line 79 def initialize(s9_serializer) @s9_serializer = s9_serializer end |
Instance Method Details
#output_property ⇒ Saxon::Serializer::OutputProperties
Returns hash-like access to the Output Properties.
84 85 86 |
# File 'lib/saxon/serializer.rb', line 84 def output_property @output_property ||= OutputProperties.new(s9_serializer) end |
#serialize(xdm_value, io) ⇒ nil #serialize(xdm_value, path) ⇒ nil #serialize(xdm_value) ⇒ String
102 103 104 105 106 107 108 109 110 111 |
# File 'lib/saxon/serializer.rb', line 102 def serialize(xdm_value, io_or_path = nil) case io_or_path when nil serialize_to_string(xdm_value) when String, Pathname serialize_to_file(xdm_value, io_or_path) else serialize_to_io(xdm_value, io_or_path) end end |
#to_java ⇒ Saxon::S9API::Serializer
Returns The underlying Saxon Serializer object.
114 115 116 |
# File 'lib/saxon/serializer.rb', line 114 def to_java s9_serializer end |