Class: Mack::Rendering::Engine::Base
- Defined in:
- lib/mack/rendering/engine/base.rb
Overview
Engines are used to transform a IO, using a supplied binding to a String.
The method ‘render’ needs to be implemented as render(io, binding) in all subclasses.
Instance Attribute Summary collapse
-
#view_template ⇒ Object
readonly
The Mack::Rendering::ViewTemplate object to be used with this engine.
Instance Method Summary collapse
-
#capture(*args, &block) ⇒ Object
See Mack::Rendering::ViewTemplate content_for for more details.
-
#initialize(view_template) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(view_template) ⇒ Base
Returns a new instance of Base.
12 13 14 |
# File 'lib/mack/rendering/engine/base.rb', line 12 def initialize(view_template) @view_template = view_template end |
Instance Attribute Details
#view_template ⇒ Object (readonly)
The Mack::Rendering::ViewTemplate object to be used with this engine.
10 11 12 |
# File 'lib/mack/rendering/engine/base.rb', line 10 def view_template @view_template end |
Instance Method Details
#capture(*args, &block) ⇒ Object
See Mack::Rendering::ViewTemplate content_for for more details.
17 18 19 |
# File 'lib/mack/rendering/engine/base.rb', line 17 def capture(*args, &block) yield end |