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


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

def initialize(size)
  @size = size
end

Instance Attribute Details

#sizeObject (readonly)


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

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


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

def sequence_size
  @size * 2
end