# class Chef::Provider::TemplateFinder

### Public Class Methods

new(run_context, cookbook_name, node) click to toggle source

    # File lib/chef/provider/template_finder.rb, line 24
    def initialize(run_context, cookbook_name, node)
      @run_context = run_context
      @cookbook_name = cookbook_name
      @node = node
    end

### Public Instance Methods

find(template_name, options = {}) click to toggle source

    # File lib/chef/provider/template_finder.rb, line 30
    def find(template_name, options = {})
      template_name = template_source_name(template_name, options)

      if options[:local]
        return template_name
      end

      cookbook_name = find_cookbook_name(options)
      cookbook = @run_context.cookbook_collection[cookbook_name]

      cookbook.preferred_filename_on_disk_location(@node, :templates, template_name)
    end

### Protected Instance Methods

find_cookbook_name(options) click to toggle source

    # File lib/chef/provider/template_finder.rb, line 52
    def find_cookbook_name(options)
      if options[:cookbook]
        options[:cookbook]
      else
        @cookbook_name
      end
    end

template_source_name(name, options) click to toggle source

    # File lib/chef/provider/template_finder.rb, line 44
    def template_source_name(name, options)
      if options[:source]
        options[:source]
      else
        name
      end
    end