Class: Tanuki::Launcher
Overview
Tanuki::Launcher is called on every request. It is used to build output starting with the default view of the root controller. Rack iterates over an instance of this object on every request.
Instance Method Summary collapse
-
#each(&block) ⇒ Object
Passes a given
blockto the requested page template tree. -
#initialize(ctrl, ctx) ⇒ Launcher
constructor
Creates a new Tanuki::Launcher with root controller
ctrlin contextctx.
Constructor Details
#initialize(ctrl, ctx) ⇒ Launcher
Creates a new Tanuki::Launcher with root controller ctrl in context ctx.
9 10 11 12 |
# File 'lib/tanuki/launcher.rb', line 9 def initialize(ctrl, ctx) @ctrl = ctrl @ctx = ctx end |
Instance Method Details
#each(&block) ⇒ Object
Passes a given block to the requested page template tree.
15 16 17 |
# File 'lib/tanuki/launcher.rb', line 15 def each(&block) @ctrl.default_view.call(proc {|out| block.call(out.to_s) }, @ctx) end |