Class: ActionView::Resolver

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

Overview

Action View Resolver

Defined Under Namespace

Classes: Path

Instance Method Summary collapse

Constructor Details

#initializeResolver

Returns a new instance of Resolver



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

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



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

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.



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

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)
  end
end

#sort_locals(locals) ⇒ Object

:nodoc:



102
103
104
105
106
# File 'actionpack/lib/action_view/template/resolver.rb', line 102

def sort_locals(locals) #:nodoc:
  locals = locals.map{ |l| l.to_s }
  locals.sort!
  locals.freeze
end