HashDiff type

Represents difference of elements between two hashes (order unimportant)

Direct parent types

Diff
Represents difference
Direct subtypes: 2

Methods

Bool(d:HashDiff) Source: stdlib.ngs:4201
Whether there is a difference

Returns

Bool

Example

hash_diff = Diff(current_properties, desired_properties)
# Implicit Bool() when using in "if": if hash_diff -> if Bool(hash_diff)
if hash_diff {
  echo("Will make modifications to the resource")
  if hash_diff.add {
    ...
  }
  if hash_diff.remove {
    ...
  }
  if hash_diff.change {
    ...
  }
}