Class: PhusionPassenger::HTMLTemplate

Class PhusionPassenger::HTMLTemplate |
In: | lib/phusion_passenger/html_template.rb
Parent: | Object

A convenience utility class for rendering our error pages.

Methods

- []=
- new
- result

Included Modules

- ERB::Util

Constants

PASSENGER_FILE_PREFIX | = | File.dirname(__FILE__)
TEMPLATE_DIR | = | "#{PASSENGER_FILE_PREFIX}/templates"

Public Class methods
new(template_name, options = {})

[ show source ]

        # File lib/phusion_passenger/html_template.rb, line 33
    33:         def initialize(template_name, options = {})
    34:                 @buffer = ''
    35:                 @template = ERB.new(File.read("#{TEMPLATE_DIR}/#{template_name}.html.erb"),
    36:                         nil, nil, '@buffer')
    37:                 options.each_pair do |name, value|
    38:                         self[name] = value
    39:                 end
    40:         end

Public Instance methods
[]=(name, value)

[ show source ]

        # File lib/phusion_passenger/html_template.rb, line 42
    42:         def []=(name, value)
    43:                 instance_variable_set("@#{name}".to_sym, value)
    44:                 return self
    45:         end

result()

[ show source ]

        # File lib/phusion_passenger/html_template.rb, line 47
    47:         def result
    48:                 return @template.result(binding)
    49:         end