Class: ActionView::PathSet
- Inherits:
-
Array
- Object
- Array
- ActionView::PathSet
- Defined in:
- lib/action_view/paths.rb
Overview
Action View PathSet
Instance Method Summary collapse
- #exists?(*args) ⇒ Boolean
- #find(path, prefix = nil, partial = false, details = {}, key = nil) ⇒ Object
- #find_all(*args) ⇒ Object
Instance Method Details
#exists?(*args) ⇒ Boolean
27 28 29 |
# File 'lib/action_view/paths.rb', line 27 def exists?(*args) find_all(*args).any? end |
#find(path, prefix = nil, partial = false, details = {}, key = nil) ⇒ Object
13 14 15 16 17 |
# File 'lib/action_view/paths.rb', line 13 def find(path, prefix = nil, partial = false, details = {}, key = nil) template = find_all(path, prefix, partial, details, key).first raise MissingTemplate.new(self, "#{prefix}/#{path}", details, partial) unless template template end |
#find_all(*args) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/action_view/paths.rb', line 19 def find_all(*args) each do |resolver| templates = resolver.find_all(*args) return templates unless templates.empty? end [] end |