Class: Luoma::CachingFileSystemLoader

Inherits:
FileSystemLoader show all
Includes:
CachingLoaderMixin
Defined in:
lib/luoma/loaders/file_system_loader.rb,
sig/luoma/loaders/file_system_loader.rbs

Overview

A file system template loader that caches parsed templates.

Instance Method Summary collapse

Methods included from CachingLoaderMixin

#cache_key, #initialize_cache, #load

Methods inherited from FileSystemLoader

#get_source, #resolve_path

Methods inherited from TemplateLoader

#get_source, #load

Constructor Details

#initialize(search_path, default_extension: nil, auto_reload: true, namespace_key: "", capacity: 300, thread_safe: false) ⇒ CachingFileSystemLoader

Returns a new instance of CachingFileSystemLoader.

Parameters:

  • search_path (String, Array[String])
  • default_extension: (String, nil) (defaults to: nil)
  • auto_reload: (Boolean) (defaults to: true)
  • namespace_key: (::String) (defaults to: "")
  • capacity: (::Integer) (defaults to: 300)
  • thread_safe: (Boolean) (defaults to: false)


57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/luoma/loaders/file_system_loader.rb', line 57

def initialize(
  search_path,
  default_extension: nil,
  auto_reload: true,
  namespace_key: "",
  capacity: 300,
  thread_safe: false
)
  super(search_path, default_extension: default_extension)

  initialize_cache(
    auto_reload: auto_reload,
    namespace_key: namespace_key,
    capacity: capacity,
    thread_safe: thread_safe
  )
end