Class: Puppet::Pops::Serialization::Extension::ObjectStart
- Includes:
- SequenceStart
- Defined in:
- lib/puppet/pops/serialization/extension.rb
Overview
The class that triggers the use of the OBJECT_START extension. The payload is the name of the object type and the number of attributes in the instance.
Instance Attribute Summary collapse
- #attribute_count ⇒ Object readonly
- #type_name ⇒ Object readonly
Instance Method Summary collapse
- #eql?(o) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(type_name, attribute_count) ⇒ ObjectStart
constructor
A new instance of ObjectStart.
- #sequence_size ⇒ Object
Constructor Details
#initialize(type_name, attribute_count) ⇒ ObjectStart
Returns a new instance of ObjectStart.
91 92 93 94 |
# File 'lib/puppet/pops/serialization/extension.rb', line 91 def initialize(type_name, attribute_count) @type_name = type_name @attribute_count = attribute_count end |
Instance Attribute Details
#attribute_count ⇒ Object (readonly)
90 91 92 |
# File 'lib/puppet/pops/serialization/extension.rb', line 90 def attribute_count @attribute_count end |
#type_name ⇒ Object (readonly)
90 91 92 |
# File 'lib/puppet/pops/serialization/extension.rb', line 90 def type_name @type_name end |
Instance Method Details
#eql?(o) ⇒ Boolean Also known as: ==
100 101 102 |
# File 'lib/puppet/pops/serialization/extension.rb', line 100 def eql?(o) o.is_a?(ObjectStart) && o.type_name == @type_name && o.attribute_count == @attribute_count end |
#hash ⇒ Object
96 97 98 |
# File 'lib/puppet/pops/serialization/extension.rb', line 96 def hash @type_name.hash * 29 + attribute_count.hash end |
#sequence_size ⇒ Object
105 106 107 |
# File 'lib/puppet/pops/serialization/extension.rb', line 105 def sequence_size @attribute_count end |