Class: ActionView::Resolver

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

Overview

Action View Resolver

Direct Known Subclasses

PathResolver

Defined Under Namespace

Classes: Cache, Path

Instance Method Summary collapse

Constructor Details

#initializeResolver

Returns a new instance of Resolver.


118
119
120
# File 'actionview/lib/action_view/template/resolver.rb', line 118

def initialize
  @cache = Cache.new
end

Instance Method Details

#clear_cacheObject


122
123
124
# File 'actionview/lib/action_view/template/resolver.rb', line 122

def clear_cache
  @cache.clear
end

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

Normalizes the arguments and passes it on to find_templates.


127
128
129
130
131
# File 'actionview/lib/action_view/template/resolver.rb', line 127

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

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


133
134
135
136
137
# File 'actionview/lib/action_view/template/resolver.rb', line 133

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

#find_all_with_query(query) ⇒ Object

:nodoc:


139
140
141
# File 'actionview/lib/action_view/template/resolver.rb', line 139

def find_all_with_query(query) # :nodoc:
  @cache.cache_query(query) { find_template_paths(File.join(@path, query)) }
end