# File lib/puppet/parser/resource/reference.rb, line 38
38:     def definedtype
39:         unless defined? @definedtype
40:             case self.type
41:             when "Class" # look for host classes
42:                 if self.title == :main
43:                     tmp = @scope.find_hostclass("")
44:                 else
45:                     unless tmp = @scope.parser.hostclass(self.title)
46:                         fail Puppet::ParseError, "Could not find class '%s'" % self.title
47:                     end
48:                 end
49:             when "Node" # look for node definitions
50:                 unless tmp = @scope.parser.node(self.title)
51:                     fail Puppet::ParseError, "Could not find node '%s'" % self.title
52:                 end
53:             else # normal definitions
54:                 # The resource type is capitalized, so we have to downcase.  Really,
55:                 # we should have a better interface for finding these, but eh.
56:                 tmp = @scope.parser.definition(self.type.downcase)
57:             end
58: 
59:             if tmp
60:                 @definedtype = tmp
61:             else
62:                 fail Puppet::ParseError, "Could not find resource type '%s'" % self.type
63:             end
64:         end
65: 
66:         @definedtype
67:     end