Class: ActionView::ReloadableTemplate::ReloadablePath
Instance Attribute Summary
#path, #paths
Instance Method Summary
collapse
#==, #eql?, new_and_loaded, #to_s, #to_str
Constructor Details
9
10
11
12
13
|
# File 'lib/action_view/reloadable_template.rb', line 9
def initialize(path)
super
@paths = {}
new_request!
end
|
Instance Method Details
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/action_view/reloadable_template.rb', line 20
def [](path)
if found_template = @paths[path]
begin
found_template.reset_cache_if_stale!
rescue TemplateDeleted
unregister_template(found_template)
self[path]
end
else
load_all_templates_from_dir(templates_dir_from_path(path))
(new_template = @paths[path]) && new_template.reset_cache_if_stale!
end
end
|
#new_request! ⇒ Object
Also known as:
load!
15
16
17
|
# File 'lib/action_view/reloadable_template.rb', line 15
def new_request!
@disk_cache = {}
end
|