# File lib/puppet/resource/catalog.rb, line 362
362:   def resource(type, title = nil)
363:     # Always create a resource reference, so that it always canonizes how we
364:     # are referring to them.
365:     if title
366:       res = Puppet::Resource.new(type, title)
367:     else
368:       # If they didn't provide a title, then we expect the first
369:       # argument to be of the form 'Class[name]', which our
370:       # Reference class canonizes for us.
371:       res = Puppet::Resource.new(nil, type)
372:     end
373:     title_key      = [res.type, res.title.to_s]
374:     uniqueness_key = [res.type, res.uniqueness_key]
375:     @resource_table[title_key] || @resource_table[uniqueness_key]
376:   end