Class: Saxon::Serializer::Destination
- Inherits:
-
Object
- Object
- Saxon::Serializer::Destination
- Includes:
- OutputProperties
- Defined in:
- lib/saxon/serializer/destination.rb
Overview
A Saxon Serializer to be used as a Destination for a transformation rather than being directly called with existing XDM objects
Instance Attribute Summary collapse
-
#invocation_lambda ⇒ Object
readonly
Returns the value of attribute invocation_lambda.
-
#s9_serializer ⇒ Object
readonly
Returns the value of attribute s9_serializer.
Instance Method Summary collapse
-
#initialize(s9_serializer, invocation_lambda, &block) ⇒ Destination
constructor
private
A new instance of Destination.
- #serialize(io_or_path = nil) ⇒ Object
-
#to_java ⇒ Saxon::S9API::Serializer
The underlying Saxon Serializer object.
Methods included from OutputProperties
Constructor Details
#initialize(s9_serializer, invocation_lambda, &block) ⇒ Destination
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 Destination.
14 15 16 17 18 19 |
# File 'lib/saxon/serializer/destination.rb', line 14 def initialize(s9_serializer, invocation_lambda, &block) @s9_serializer, @invocation_lambda = s9_serializer, invocation_lambda if block_given? instance_exec(&block) end end |
Instance Attribute Details
#invocation_lambda ⇒ Object (readonly)
Returns the value of attribute invocation_lambda.
11 12 13 |
# File 'lib/saxon/serializer/destination.rb', line 11 def invocation_lambda @invocation_lambda end |
#s9_serializer ⇒ Object (readonly)
Returns the value of attribute s9_serializer.
11 12 13 |
# File 'lib/saxon/serializer/destination.rb', line 11 def s9_serializer @s9_serializer end |
Instance Method Details
#serialize(io) ⇒ nil #serialize(path) ⇒ nil #serialize ⇒ String
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/saxon/serializer/destination.rb', line 32 def serialize(io_or_path = nil) case io_or_path when nil serialize_to_string when String, Pathname serialize_to_file(io_or_path) else serialize_to_io(io_or_path) end end |
#to_java ⇒ Saxon::S9API::Serializer
Returns The underlying Saxon Serializer object.
44 45 46 |
# File 'lib/saxon/serializer/destination.rb', line 44 def to_java s9_serializer end |