Class: Hanami::Router::Block Private

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

Since:

  • 2.0.0

Defined Under Namespace

Classes: Context

Instance Method Summary collapse

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.

Since:

  • 2.0.0



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.

Since:

  • 2.0.0



83
84
85
# File 'lib/hanami/router/block.rb', line 83

def call(env)
  @context_class.new(@blk, env).call
end