Class: Howdoc::Templates::Context
- Inherits:
-
Object
- Object
- Howdoc::Templates::Context
- Defined in:
- lib/howdoc/templates.rb
Overview
Renders a template against a hash of assigns, exposed to the template as instance variables.
Instance Method Summary collapse
-
#initialize(assigns) ⇒ Context
constructor
A new instance of Context.
-
#render(relative, extra = {}) ⇒ Object
Renders another template with the same assigns plus any extras, for partials that need a single item out of a collection.
Constructor Details
#initialize(assigns) ⇒ Context
Returns a new instance of Context.
19 20 21 22 |
# File 'lib/howdoc/templates.rb', line 19 def initialize(assigns) @assigns = assigns assigns.each { |name, value| instance_variable_set(:"@#{name}", value) } end |