Class: ActionView::PathSet

Inherits:
Array
  • Object
show all
Defined in:
lib/action_view/paths.rb

Overview

Action View PathSet

Instance Method Summary collapse

Instance Method Details

#exists?(*args) ⇒ Boolean

Returns:

  • (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

Raises:



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