# File lib/puppet/type.rb, line 831
831:     def propertychanges(currentvalues)
832:         # If we are changing the existence of the object, then none of
833:         # the other properties matter.
834:         changes = []
835:         ensureparam = @parameters[:ensure]
836: 
837:         # This allows resource types to have 'ensure' be a parameter, which allows them to
838:         # just pass the parameter on to other generated resources.
839:         ensureparam = nil unless ensureparam.is_a?(Puppet::Property)
840:         if ensureparam && !currentvalues.include?(ensureparam)
841:             raise Puppet::DevError, "Parameter ensure defined but missing from current values"
842:         end
843: 
844:         if ensureparam and ! ensureparam.insync?(currentvalues[ensureparam])
845:             changes << Puppet::Transaction::Change.new(ensureparam, currentvalues[ensureparam])
846:         # Else, if the 'ensure' property is correctly absent, then do
847:         # nothing
848:         elsif ensureparam and currentvalues[ensureparam] == :absent
849:             return []
850:         else
851:             changes = properties().find_all { |property|
852:                 currentvalues[property] ||= :absent
853:                 ! property.insync?(currentvalues[property])
854:             }.collect { |property|
855:                 Puppet::Transaction::Change.new(property, currentvalues[property])
856:             }
857:         end
858: 
859:         if Puppet[:debug] and changes.length > 0
860:             self.debug("Changing " + changes.collect { |ch| ch.property.name }.join(","))
861:         end
862: 
863:         changes
864:     end