summaryrefslogtreecommitdiff
path: root/lib/chef/resource_collection
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2014-10-17 08:30:53 -0500
committertyler-ball <tyleraball@gmail.com>2014-10-17 08:30:53 -0500
commit9323a77206955327fef2f17a42ca5e66c864cb26 (patch)
treea02afc15ce5340d5a10906e5d6868f4b26f12f0f /lib/chef/resource_collection
parentb4adfb4cee189f2d3fdc534a24077269616cdd28 (diff)
downloadchef-9323a77206955327fef2f17a42ca5e66c864cb26.tar.gz
Cleaning up based on review comments
Diffstat (limited to 'lib/chef/resource_collection')
-rw-r--r--lib/chef/resource_collection/resource_set.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/resource_collection/resource_set.rb b/lib/chef/resource_collection/resource_set.rb
index e3287951d7..6425c2ab08 100644
--- a/lib/chef/resource_collection/resource_set.rb
+++ b/lib/chef/resource_collection/resource_set.rb
@@ -40,8 +40,10 @@ class Chef
@resources_by_key.keys
end
- def insert_as(resource, resource_type=resource.resource_name, instance_name=resource.name)
+ def insert_as(resource, resource_type=nil, instance_name=nil)
is_chef_resource!(resource)
+ resource_type ||= resource.resource_name
+ instance_name ||= resource.name
key = ResourceSet.create_key(resource_type, instance_name)
@resources_by_key[key] = resource
end