Class: Slim::Engine
Constant Summary
Constants included from Compiler
Compiler::AUTOCLOSED, Compiler::REGEX
Instance Attribute Summary collapse
-
#compiled ⇒ Object
readonly
Returns the value of attribute compiled.
-
#optimized ⇒ Object
readonly
Returns the value of attribute optimized.
Instance Method Summary collapse
-
#initialize(template) ⇒ Slim::Engine
constructor
Instance of engine.
- #render(scope = Object.new, locals = {}) ⇒ Object
Methods included from Compiler
Methods included from Optimizer
Constructor Details
#initialize(template) ⇒ Slim::Engine
Returns instance of engine.
10 11 12 13 |
# File 'lib/slim/engine.rb', line 10 def initialize(template) @template = template compile end |
Instance Attribute Details
#compiled ⇒ Object (readonly)
Returns the value of attribute compiled.
5 6 7 |
# File 'lib/slim/engine.rb', line 5 def compiled @compiled end |
#optimized ⇒ Object (readonly)
Returns the value of attribute optimized.
6 7 8 |
# File 'lib/slim/engine.rb', line 6 def optimized @optimized end |
Instance Method Details
#render(scope = Object.new, locals = {}) ⇒ Object
15 16 17 |
# File 'lib/slim/engine.rb', line 15 def render(scope = Object.new, locals = {}) scope.instance_eval(optimized) end |