Method: Puppet::Resource.resource_type

Defined in:
lib/puppet/resource.rb

.resource_type(type, title, environment) ⇒ Puppet::Type, Puppet::Resource::Type

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The resource’s type implementation



353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/puppet/resource.rb', line 353

def self.resource_type(type, title, environment)
  case type
  when TYPE_CLASS; environment.known_resource_types.hostclass(title == :main ? "" : title)
  when TYPE_NODE; environment.known_resource_types.node(title)
  when TYPE_SITE; environment.known_resource_types.site(nil)
  else
    result = Puppet::Type.type(type)
    if !result
      krt = environment.known_resource_types
      result = krt.definition(type) || krt.application(type)
    end
    result
  end
end