Class: Hanami::Router::Block Private
- Inherits:
-
Object
- Object
- Hanami::Router::Block
- Defined in:
- lib/hanami/router/block.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Block endpoint
Defined Under Namespace
Classes: Context
Instance Method Summary collapse
- #call(env) ⇒ Object private
-
#initialize(context_class, blk) ⇒ Block
constructor
private
A new instance of Block.
Constructor Details
#initialize(context_class, blk) ⇒ Block
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Block.
75 76 77 78 79 |
# File 'lib/hanami/router/block.rb', line 75 def initialize(context_class, blk) @context_class = context_class || Context @blk = blk freeze end |
Instance Method Details
#call(env) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
83 84 85 |
# File 'lib/hanami/router/block.rb', line 83 def call(env) @context_class.new(@blk, env).call end |