diff options
Diffstat (limited to 'lib/chef/resource')
-rw-r--r-- | lib/chef/resource/resource_notification.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/chef/resource/resource_notification.rb b/lib/chef/resource/resource_notification.rb index a27ed961c7..4fd61ad1f8 100644 --- a/lib/chef/resource/resource_notification.rb +++ b/lib/chef/resource/resource_notification.rb @@ -20,7 +20,15 @@ require 'chef/resource' class Chef class Resource - class Notification < Struct.new(:resource, :action, :notifying_resource) + class Notification + + attr_accessor :resource, :action, :notifying_resource + + def initialize(resource, action, notifying_resource) + @resource = resource + @action = action + @notifying_resource = notifying_resource + end def duplicates?(other_notification) unless other_notification.respond_to?(:resource) && other_notification.respond_to?(:action) @@ -104,6 +112,11 @@ is defined near #{resource.source_line} raise err end + def ==(other) + return false unless other.is_a?(self.class) + other.resource == resource && other.action == action && other.notifying_resource == notifying_resource + end + end end end |