Class: ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Stateful Private
- Inherits:
-
Custom
- Object
- Custom
- ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Stateful
- Defined in:
- lib/convenient_service/support/middleware/stack_builder/entities/builders/stateful.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.
Instance Attribute Summary
Attributes inherited from Custom
Instance Method Summary collapse
-
#call(env) ⇒ Object
private
Can be any type.
-
#call_with_original(env, original) ⇒ Object
private
Can be any type.
- #initialize(**kwargs) ⇒ void constructor private
Methods inherited from Custom
#==, #clear, #delete, #dup, #empty?, #has?, #insert, #insert_after, #insert_after_each, #insert_before_each, #replace, #to_a, #unshift, #use
Methods included from AbstractMethod
Methods included from Concern
Constructor Details
#initialize(**kwargs) ⇒ void
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.
19 20 21 22 23 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/stateful.rb', line 19 def initialize(**kwargs) super @index = -1 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.
Returns Can be any type.
48 49 50 51 52 53 54 55 56 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/stateful.rb', line 48 def call(env) self.index += 1 return env if index == stack.size stack[index].new(self).call(env) ensure self.index = -1 end |
#call_with_original(env, original) ⇒ 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.
Returns Can be any type.
33 34 35 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/stateful.rb', line 33 def call_with_original(env, original) dup.use(Custom::Entities::ProcWithNew.new(original)).call(env) end |