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.
14 15 16 |
# File 'lib/puppet/pops/serialization/json.rb', line 14 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.
33 34 35 |
# File 'lib/puppet/pops/serialization/json.rb', line 33 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.
21 22 23 |
# File 'lib/puppet/pops/serialization/json.rb', line 21 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.
25 26 27 |
# File 'lib/puppet/pops/serialization/json.rb', line 25 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.
29 30 31 |
# File 'lib/puppet/pops/serialization/json.rb', line 29 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.
37 38 39 |
# File 'lib/puppet/pops/serialization/json.rb', line 37 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.
41 42 43 |
# File 'lib/puppet/pops/serialization/json.rb', line 41 def to_json @packer.to_json end |