Class: Puppet::Pops::Types::KeyMismatch Abstract

Inherits:
Mismatch show all
Defined in:
lib/puppet/pops/types/type_mismatch_describer.rb

Overview

This class is abstract.

Direct Known Subclasses

ExtraneousKey, MissingKey, MissingParameter

Instance Attribute Summary collapse

Attributes inherited from Mismatch

#path

Instance Method Summary collapse

Methods inherited from Mismatch

#canonical_path, #chop_path, #format, #merge, #message, #path_string, #to_s

Methods included from TenseVariants

#it_does_not_expect, #it_expects, #it_has_no

Constructor Details

#initialize(path, key) ⇒ KeyMismatch

Returns a new instance of KeyMismatch.



176
177
178
179
# File 'lib/puppet/pops/types/type_mismatch_describer.rb', line 176

def initialize(path, key)
  super(path)
  @key = key
end

Instance Attribute Details

#keyObject (readonly)



174
175
176
# File 'lib/puppet/pops/types/type_mismatch_describer.rb', line 174

def key
  @key
end

Instance Method Details

#==(o) ⇒ Object



181
182
183
# File 'lib/puppet/pops/types/type_mismatch_describer.rb', line 181

def ==(o)
  super.==(o) && key == o.key
end

#hashObject



185
186
187
# File 'lib/puppet/pops/types/type_mismatch_describer.rb', line 185

def hash
  super.hash ^ key.hash
end