Class: ActionView::PathSet::Path
- Inherits:
-
Object
- Object
- ActionView::PathSet::Path
- Defined in:
- lib/bolt/adapters/rails.rb,
lib/bolt/adapters/rails.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#[](template_path) ⇒ Object
make it always return a refreshed template!.
-
#eager_load_templates? ⇒ Boolean
:nodoc:.
-
#initialize(path, load = true) ⇒ Path
constructor
A new instance of Path.
Constructor Details
#initialize(path, load = true) ⇒ Path
Returns a new instance of Path.
106 107 108 109 110 |
# File 'lib/bolt/adapters/rails.rb', line 106 def initialize(path, load = true) #raise ArgumentError, "path already is a Path class" if path.is_a?(Path) @path = path.freeze reload! if load end |
Instance Method Details
#[](template_path) ⇒ Object
make it always return a refreshed template!
90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/bolt/adapters/rails.rb', line 90 def [](template_path) begin template = Template.new(template_path, path.to_s) rescue ::ActionView::MissingTemplate begin template_path = template_path + '.erb' if !template_path.match('.erb') template = Template.new(template_path, path.to_s) rescue ::ActionView::MissingTemplate end end return template end |
#eager_load_templates? ⇒ Boolean
:nodoc:
39 40 41 |
# File 'lib/bolt/adapters/rails.rb', line 39 def eager_load_templates? false end |