Class: Superglue::Resolver
- Inherits:
-
ActionView::FileSystemResolver
- Object
- ActionView::FileSystemResolver
- Superglue::Resolver
- Defined in:
- lib/superglue/resolver.rb
Defined Under Namespace
Classes: JsxPathParser
Instance Method Summary collapse
- #clear_cache ⇒ Object
- #filter_and_sort_by_details(templates, requested_details) ⇒ Object
-
#initialize(path) ⇒ Resolver
constructor
A new instance of Resolver.
- #source_for_template(template) ⇒ Object
Constructor Details
#initialize(path) ⇒ Resolver
Returns a new instance of Resolver.
34 35 36 37 38 39 |
# File 'lib/superglue/resolver.rb', line 34 def initialize(path) raise ArgumentError, "path already is a Resolver class" if path.is_a?(ActionView::Resolver) @unbound_templates = Concurrent::Map.new @path_parser = JsxPathParser.new @path = File.(path) end |
Instance Method Details
#clear_cache ⇒ Object
41 42 43 44 |
# File 'lib/superglue/resolver.rb', line 41 def clear_cache @unbound_templates.clear @path_parser = JsxPathParser.new end |
#filter_and_sort_by_details(templates, requested_details) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/superglue/resolver.rb', line 50 def filter_and_sort_by_details(templates, requested_details) if requested_details.formats.empty? templates else [] end end |
#source_for_template(template) ⇒ Object
46 47 48 |
# File 'lib/superglue/resolver.rb', line 46 def source_for_template(template) "''" end |