Class: Puppet::Pops::Serialization::Extension::MapStart

Inherits:
Object
  • Object
show all
Includes:
NotTabulated, SequenceStart
Defined in:
lib/puppet/pops/serialization/extension.rb

Overview

The class that triggers the use of the MAP_START extension. The payload is the map size (number of entries)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(size) ⇒ MapStart

Returns a new instance of MapStart.



64
65
66
# File 'lib/puppet/pops/serialization/extension.rb', line 64

def initialize(size)
  @size = size
end

Instance Attribute Details

#sizeObject (readonly)



63
64
65
# File 'lib/puppet/pops/serialization/extension.rb', line 63

def size
  @size
end

Instance Method Details

#sequence_sizeObject

Sequence size is twice the map size since each entry is written as key and value



69
70
71
# File 'lib/puppet/pops/serialization/extension.rb', line 69

def sequence_size
  @size * 2
end