Class: Puppet::Pops::Types::ExpectedActualMismatch

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

Direct Known Subclasses

SizeMismatch, TypeMismatch

Instance Attribute Summary collapse

Attributes inherited from Mismatch

#path

Instance Method Summary collapse

Methods inherited from Mismatch

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

Constructor Details

#initialize(path, expected, actual) ⇒ ExpectedActualMismatch

Returns a new instance of ExpectedActualMismatch.



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

def initialize(path, expected, actual)
  super(path)
  @expected = expected
  @actual = actual
end

Instance Attribute Details

#actualObject (readonly)



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

def actual
  @actual
end

#expectedObject (readonly)



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

def expected
  @expected
end

Instance Method Details

#==(o) ⇒ Object



189
190
191
# File 'lib/puppet/pops/types/type_mismatch_describer.rb', line 189

def ==(o)
  super.==(o) && expected == o.expected && actual == o.actual
end

#hashObject



193
194
195
196
197
# File 'lib/puppet/pops/types/type_mismatch_describer.rb', line 193

def hash
  hash = super.hash
  hash = hash * 31 + expected.hash
  hash * 31 + actual.hash
end