Class: ActionView::FileSystemResolver

Inherits:
PathResolver show all
Defined in:
lib/action_view/template/resolver.rb

Overview

A resolver that loads files from the filesystem.

Constant Summary

Constants inherited from PathResolver

PathResolver::DEFAULT_PATTERN, PathResolver::EXTENSIONS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PathResolver

#clear_cache

Methods inherited from Resolver

#clear_cache, #find_all, #find_all_with_query

Constructor Details

#initialize(path, pattern = nil) ⇒ FileSystemResolver

Returns a new instance of FileSystemResolver.

Raises:

  • (ArgumentError)


299
300
301
302
303
# File 'lib/action_view/template/resolver.rb', line 299

def initialize(path, pattern = nil)
  raise ArgumentError, "path already is a Resolver class" if path.is_a?(Resolver)
  super(pattern)
  @path = File.expand_path(path)
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



297
298
299
# File 'lib/action_view/template/resolver.rb', line 297

def path
  @path
end

Instance Method Details

#eql?(resolver) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


310
311
312
# File 'lib/action_view/template/resolver.rb', line 310

def eql?(resolver)
  self.class.equal?(resolver.class) && to_path == resolver.to_path
end

#to_sObject Also known as: to_path



305
306
307
# File 'lib/action_view/template/resolver.rb', line 305

def to_s
  @path.to_s
end