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: Cache, Path

Instance Method Summary collapse

Constructor Details

#initializeResolver

Returns a new instance of Resolver.



107
108
109
# File 'lib/action_view/template/resolver.rb', line 107

def initialize
  @cache = Cache.new
end

Instance Method Details

#clear_cacheObject



111
112
113
# File 'lib/action_view/template/resolver.rb', line 111

def clear_cache
  @cache.clear
end

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

Normalizes the arguments and passes it on to find_templates.



116
117
118
119
120
121
122
# File 'lib/action_view/template/resolver.rb', line 116

def find_all(name, prefix = nil, partial = false, details = {}, key = nil, locals = [])
  locals = locals.map(&:to_s).sort!.freeze

  cached(key, [name, prefix, partial], details, locals) do
    _find_all(name, prefix, partial, details, key, locals)
  end
end

#find_all_with_query(query) ⇒ Object

:nodoc:



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

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