Class: Rack::WebProfiler::Collector::View
- Defined in:
- lib/rack/web_profiler/collector.rb
Overview
View
Defined Under Namespace
Modules: Helpers Classes: Context
Instance Method Summary collapse
- #context ⇒ Object
-
#read_template(template) ⇒ String
Read a template.
Methods inherited from View
Constructor Details
This class inherits a constructor from Rack::WebProfiler::View
Instance Method Details
#context ⇒ Object
174 175 176 |
# File 'lib/rack/web_profiler/collector.rb', line 174 def context @context ||= Context.new end |
#read_template(template) ⇒ String
Read a template. Returns file content if template is a file path.
183 184 185 186 187 188 |
# File 'lib/rack/web_profiler/collector.rb', line 183 def read_template(template) unless template.empty? return ::File.read(template) if ::File.exist?(template) end template end |