Class: Mack::Rendering::Engine::Base

Inherits:
Object
  • Object
show all
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.

Direct Known Subclasses

Builder, Erubis

Instance Attribute Summary collapse

Instance Method Summary collapse

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_templateObject (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