Class: Puppet::Pops::Serialization::JSON::Writer Private
- Inherits:
-
AbstractWriter
- Object
- AbstractWriter
- Puppet::Pops::Serialization::JSON::Writer
- Defined in:
- lib/puppet/pops/serialization/json.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A Writer that writes output in JSON format
Instance Method Summary collapse
- #build_payload {|@packer| ... } ⇒ Object private
-
#clear_io ⇒ Object
private
Clear the underlying io stream but does not clear tabulation cache Specifically designed to enable tabulation to span more than one separately deserialized object.
- #extension_packer ⇒ Object private
-
#initialize(io, options = {}) ⇒ Writer
constructor
private
A new instance of Writer.
- #packer ⇒ Object private
- #to_a ⇒ Object private
- #to_json ⇒ Object private
Methods inherited from AbstractWriter
#finish, #inspect, #register_type, #register_types, #supports_binary?, #to_s, #write, #write_tpl, #write_tpl_qname
Constructor Details
#initialize(io, options = {}) ⇒ Writer
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 Writer.
15 16 17 |
# File 'lib/puppet/pops/serialization/json.rb', line 15 def initialize(io, = {}) super(Packer.new(io, ), ) end |
Instance Method Details
#build_payload {|@packer| ... } ⇒ Object
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.
34 35 36 |
# File 'lib/puppet/pops/serialization/json.rb', line 34 def build_payload yield(@packer) end |
#clear_io ⇒ Object
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.
Clear the underlying io stream but does not clear tabulation cache Specifically designed to enable tabulation to span more than one separately deserialized object.
22 23 24 |
# File 'lib/puppet/pops/serialization/json.rb', line 22 def clear_io @packer.clear_io end |
#extension_packer ⇒ Object
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.
26 27 28 |
# File 'lib/puppet/pops/serialization/json.rb', line 26 def extension_packer @packer end |
#packer ⇒ Object
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.
30 31 32 |
# File 'lib/puppet/pops/serialization/json.rb', line 30 def packer @packer end |
#to_a ⇒ Object
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.
38 39 40 |
# File 'lib/puppet/pops/serialization/json.rb', line 38 def to_a @packer.to_a end |
#to_json ⇒ Object
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.
42 43 44 |
# File 'lib/puppet/pops/serialization/json.rb', line 42 def to_json @packer.to_json end |