Parent

Class Index [+]

Quicksearch

ActionView::Resolver

Action View Resolver

Public Class Methods

new() click to toggle source
    # File lib/action_view/template/resolver.rb, line 8
 8:     def initialize
 9:       @cached = Hash.new { |h1,k1| h1[k1] =
10:         Hash.new { |h2,k2| h2[k2] = Hash.new { |h3, k3| h3[k3] = {} } } }
11:     end

Public Instance Methods

clear_cache() click to toggle source
    # File lib/action_view/template/resolver.rb, line 13
13:     def clear_cache
14:       @cached.clear
15:     end
find_all(name, prefix=nil, partial=false, details={}, key=nil) click to toggle source

Normalizes the arguments and passes it on to find_template.

    # File lib/action_view/template/resolver.rb, line 18
18:     def find_all(name, prefix=nil, partial=false, details={}, key=nil)
19:       cached(key, prefix, name, partial) do
20:         find_templates(name, prefix, partial, details)
21:       end
22:     end

Private Instance Methods

cached(key, prefix, name, partial) click to toggle source
    # File lib/action_view/template/resolver.rb, line 37
37:     def cached(key, prefix, name, partial)
38:       return yield unless key && caching?
39:       @cached[key][prefix][name][partial] ||= yield
40:     end
caching?() click to toggle source
    # File lib/action_view/template/resolver.rb, line 26
26:     def caching?
27:       @caching ||= !defined?(Rails.application) || Rails.application.config.cache_classes
28:     end
find_templates(name, prefix, partial, details) click to toggle source

This is what child classes implement. No defaults are needed because Resolver guarantees that the arguments are present and normalized.

    # File lib/action_view/template/resolver.rb, line 33
33:     def find_templates(name, prefix, partial, details)
34:       raise NotImplementedError
35:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.