Class: ActionView::Resolver

Inherits:
Object
  • Object
show all
Defined in:
lib/action_view/template/resolver.rb

Overview

Action View Resolver

Direct Known Subclasses

PathResolver

Defined Under Namespace

Classes: Path

Instance Method Summary collapse

Constructor Details

#initializeResolver

Returns a new instance of Resolver.



34
35
36
37
# File 'lib/action_view/template/resolver.rb', line 34

def initialize
  @cached = Hash.new { |h1,k1| h1[k1] = Hash.new { |h2,k2|
    h2[k2] = Hash.new { |h3,k3| h3[k3] = Hash.new { |h4,k4| h4[k4] = {} } } } }
end

Instance Method Details

#clear_cacheObject



39
40
41
# File 'lib/action_view/template/resolver.rb', line 39

def clear_cache
  @cached.clear
end

#find_all(name, prefix = nil, partial = false, details = {}, key = nil, locals = []) ⇒ Object

Normalizes the arguments and passes it on to find_template.



44
45
46
47
48
# File 'lib/action_view/template/resolver.rb', line 44

def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[])
  cached(key, [name, prefix, partial], details, locals) do
    find_templates(name, prefix, partial, details, false)
  end
end

#find_all_anywhere(name, prefix, partial = false, details = {}, key = nil, locals = []) ⇒ Object



50
51
52
53
54
# File 'lib/action_view/template/resolver.rb', line 50

def find_all_anywhere(name, prefix, partial=false, details={}, key=nil, locals=[])
  cached(key, [name, prefix, partial], details, locals) do
    find_templates(name, prefix, partial, details, true)
  end
end