Class: PhusionPassenger::HTMLTemplate
- Includes:
- ERB::Util
- Defined in:
- lib/phusion_passenger/html_template.rb
Overview
A convenience utility class for rendering our error pages.
Instance Method Summary collapse
- #[]=(name, value) ⇒ Object
-
#initialize(template_name, options = {}) ⇒ HTMLTemplate
constructor
A new instance of HTMLTemplate.
- #result ⇒ Object
Constructor Details
#initialize(template_name, options = {}) ⇒ HTMLTemplate
Returns a new instance of HTMLTemplate.
31 32 33 34 35 36 37 38 |
# File 'lib/phusion_passenger/html_template.rb', line 31 def initialize(template_name, = {}) @buffer = '' @template = ERB.new(File.read("#{TEMPLATES_DIR}/#{template_name}.html.erb"), nil, nil, '@buffer') .each_pair do |name, value| self[name] = value end end |
Instance Method Details
#[]=(name, value) ⇒ Object
40 41 42 43 |
# File 'lib/phusion_passenger/html_template.rb', line 40 def []=(name, value) instance_variable_set("@#{name}".to_sym, value) return self end |
#result ⇒ Object
45 46 47 |
# File 'lib/phusion_passenger/html_template.rb', line 45 def result return @template.result(binding) end |