class Haml::Engine
def initialize(template, options = {})
-
(Haml::Error)
- if there's a Haml syntax error in the template
Parameters:
-
options
({Symbol => Object}
) -- An options hash; -
template
(String
) -- The Haml template
def initialize(template, options = {}) @options = Options.new(options) @template = check_haml_encoding(template) do |msg, line| raise Haml::Error.new(msg, line) end initialize_encoding options[:encoding] @parser = @options.parser_class.new(@template, @options) @compiler = @options.compiler_class.new(@options) @compiler.compile(@parser.parse) end