    # File lib/chef/resource_collection.rb, line 104
        def lookup(resource)
          lookup_by = nil
          if resource.kind_of?(Chef::Resource)
            lookup_by = resource.to_s
          elsif resource.kind_of?(String)
            lookup_by = resource
          else
            raise ArgumentError, "Must pass a Chef::Resource or String to lookup"
          end
          res = @resources_by_name[lookup_by]
          unless res
            raise Chef::Exceptions::ResourceNotFound, "Cannot find a resource matching #{lookup_by} (did you define it first?)"
          end
          @resources[res]
        end