Class: Confinement::Rendering::RenderChain
- Inherits:
-
Object
- Object
- Confinement::Rendering::RenderChain
- Defined in:
- lib/confinement.rb
Instance Method Summary collapse
- #call(&block) ⇒ Object
-
#initialize(body:, path:, renderers:, view_context:) ⇒ RenderChain
constructor
A new instance of RenderChain.
Constructor Details
#initialize(body:, path:, renderers:, view_context:) ⇒ RenderChain
Returns a new instance of RenderChain.
617 618 619 620 621 622 |
# File 'lib/confinement.rb', line 617 def initialize(body:, path:, renderers:, view_context:) @body = body @path = path @renderers = renderers @view_context = view_context end |
Instance Method Details
#call(&block) ⇒ Object
624 625 626 627 628 |
# File 'lib/confinement.rb', line 624 def call(&block) @renderers.reduce(@body) do |memo, renderer| renderer.call(memo, @view_context, path: @path, &block) end end |