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.



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

def initialize(size)
  @size = size
end

Instance Attribute Details

#sizeObject (readonly)



67
68
69
# File 'lib/puppet/pops/serialization/extension.rb', line 67

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



74
75
76
# File 'lib/puppet/pops/serialization/extension.rb', line 74

def sequence_size
  @size * 2
end