Class: PrecompiledHaml::Engine
- Inherits:
-
Haml::Engine
- Object
- Haml::Engine
- PrecompiledHaml::Engine
- Defined in:
- lib/precompiled_haml/engine.rb
Instance Method Summary collapse
-
#initialize(template, options = {}) ⇒ Engine
constructor
This is identical to Haml::Engine#initialize, cause I don’t undestand how to call super method in inhereted class context (to use PrecompiledHaml::Options instead of Haml::Options) gist.github.com/Mik-die/5321100.
Constructor Details
#initialize(template, options = {}) ⇒ Engine
This is identical to Haml::Engine#initialize, cause I don’t undestand how to call super method in inhereted class context (to use PrecompiledHaml::Options instead of Haml::Options) gist.github.com/Mik-die/5321100
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/precompiled_haml/engine.rb', line 11 def initialize(template, = {}) @options = Options.new() @template = check_haml_encoding(template) do |msg, line| raise Haml::Error.new(msg, line) end initialize_encoding [:encoding] @parser = @options.parser_class.new(@template, @options) @compiler = @options.compiler_class.new(@options) @compiler.compile(@parser.parse) end |