Class: ActionView::PathSet

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

Overview

Action View PathSet

Instance Method Summary collapse

Methods inherited from Array

#as_json, #encode_json, #extract_options!, #fifth, #forty_two, #fourth, #from, #in_groups, #in_groups_of, #sample, #second, #split, #third, #to, #to_formatted_s, #to_param, #to_query, #to_sentence, #to_xml, #uniq_by, #uniq_by!, wrap

Instance Method Details

#exists?(*args) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#find(*args) ⇒ Object



13
14
15
# File 'actionpack/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 'actionpack/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