Class: Puppet::Pops::Serialization::Extension::PcoreObjectStart
- Includes:
- SequenceStart
- Defined in:
- lib/puppet/pops/serialization/extension.rb
Overview
The class that triggers the use of the PCORE_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) ⇒ PcoreObjectStart
constructor
A new instance of PcoreObjectStart.
- #sequence_size ⇒ Object
Constructor Details
#initialize(type_name, attribute_count) ⇒ PcoreObjectStart
Returns a new instance of PcoreObjectStart.
106 107 108 109 |
# File 'lib/puppet/pops/serialization/extension.rb', line 106 def initialize(type_name, attribute_count) @type_name = type_name @attribute_count = attribute_count end |
Instance Attribute Details
#attribute_count ⇒ Object (readonly)
104 105 106 |
# File 'lib/puppet/pops/serialization/extension.rb', line 104 def attribute_count @attribute_count end |
#type_name ⇒ Object (readonly)
104 105 106 |
# File 'lib/puppet/pops/serialization/extension.rb', line 104 def type_name @type_name end |
Instance Method Details
#eql?(o) ⇒ Boolean Also known as: ==
115 116 117 |
# File 'lib/puppet/pops/serialization/extension.rb', line 115 def eql?(o) o.is_a?(PcoreObjectStart) && o.type_name == @type_name && o.attribute_count == @attribute_count end |
#hash ⇒ Object
111 112 113 |
# File 'lib/puppet/pops/serialization/extension.rb', line 111 def hash @type_name.hash * 29 + attribute_count.hash end |
#sequence_size ⇒ Object
120 121 122 |
# File 'lib/puppet/pops/serialization/extension.rb', line 120 def sequence_size @attribute_count end |