Class: Shoryuken::Middleware::Entry Private

Inherits:
Object
  • Object
show all
Defined in:
lib/shoryuken/middleware/entry.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.

Represents an entry in a middleware chain, storing the middleware class and any arguments needed for its instantiation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, *args) ⇒ Entry

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.

Creates a new middleware entry.

Parameters:

  • klass (Class)

    The middleware class

  • args (Array)

    Arguments to pass to the middleware constructor



17
18
19
20
# File 'lib/shoryuken/middleware/entry.rb', line 17

def initialize(klass, *args)
  @klass = klass
  @args  = args
end

Instance Attribute Details

#klassClass (readonly)

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 The middleware class this entry represents.

Returns:

  • (Class)

    The middleware class this entry represents



11
12
13
# File 'lib/shoryuken/middleware/entry.rb', line 11

def klass
  @klass
end

Instance Method Details

#make_newObject

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.

Creates a new instance of the middleware class with the stored arguments.

Returns:

  • (Object)

    A new instance of the middleware class



25
26
27
# File 'lib/shoryuken/middleware/entry.rb', line 25

def make_new
  @klass.new(*@args)
end