Class: ActionView::PathSet

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

Overview

Action View PathSet

Instance Method Summary collapse

Instance Method Details

#exists?(*args) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/action_view/path_set.rb', line 28

def exists?(*args)
  find_all(*args).any?
end

#find(*args) ⇒ Object



13
14
15
# File 'lib/action_view/path_set.rb', line 13

def find(*args)
  find_all(*args).first || raise(MissingTemplate.new(self, *args))
end

#find_all(path, prefixes = [], *args) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/action_view/path_set.rb', line 17

def find_all(path, prefixes = [], *args)
  prefixes = [prefixes] if String === prefixes
  prefixes.each do |prefix|
    each do |resolver|
      templates = resolver.find_all(path, prefix, *args)
      return templates unless templates.empty?
    end
  end
  []
end