Class: ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom Private
- Inherits:
-
Object
- Object
- ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom
- Includes:
- AbstractMethod
- Defined in:
- lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb,
lib/convenient_service/support/middleware/stack_builder/entities/builders/custom/constants.rb,
lib/convenient_service/support/middleware/stack_builder/entities/builders/custom/exceptions.rb,
lib/convenient_service/support/middleware/stack_builder/entities/builders/custom/entities/proc_with_new.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.
Defined Under Namespace
Modules: Constants, Entities, Exceptions
Instance Attribute Summary collapse
- #name ⇒ Object readonly private
- #stack ⇒ Object readonly private
Instance Method Summary collapse
- #==(other) ⇒ Boolean? private
-
#call ⇒ Object
private
Can be any type.
-
#call_with_original ⇒ Object
private
Can be any type.
- #clear ⇒ Boolean private
- #delete(index_or_middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom (also: #remove) private
- #dup ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom private
- #empty? ⇒ Boolean private
-
#has?(some_middleware) ⇒ Boolean
private
rubocop:disable Performance/RedundantEqualityComparisonBlock.
- #initialize(**kwargs) ⇒ void constructor private
- #insert(index_or_middleware, other_middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom (also: #insert_before) private
- #insert_after(index_or_middleware, other_middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom private
- #insert_after_each(other_middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom private
- #insert_before_each(other_middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom private
- #replace(index_or_middleware, other_middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom private
- #to_a ⇒ Array private
- #unshift(middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom (also: #prepend) private
- #use(middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom (also: #append) private
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.
47 48 49 50 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 47 def initialize(**kwargs) @name = kwargs.fetch(:name) { "Stack" } @stack = kwargs.fetch(:stack) { [] } end |
Instance Attribute Details
#name ⇒ Object (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.
31 32 33 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 31 def name @name end |
#stack ⇒ Object (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.
25 26 27 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 25 def stack @stack end |
Instance Method Details
#==(other) ⇒ Boolean?
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.
199 200 201 202 203 204 205 206 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 199 def ==(other) return unless other.instance_of?(self.class) return false if name != other.name return false if stack != other.stack true end |
#call ⇒ 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.
41 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 41 abstract_method :call |
#call_with_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.
36 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 36 abstract_method :call_with_original |
#clear ⇒ Boolean
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.
74 75 76 77 78 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 74 def clear stack.clear self end |
#delete(index_or_middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom Also known as: remove
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.
182 183 184 185 186 187 188 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 182 def delete(index_or_middleware) index = cast_index(index_or_middleware) stack.delete_at(index) self end |
#dup ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom
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.
218 219 220 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 218 def dup self.class.new(name: name.dup, stack: stack.dup) end |
#empty? ⇒ Boolean
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.
55 56 57 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 55 def empty? stack.empty? end |
#has?(some_middleware) ⇒ Boolean
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.
rubocop:disable Performance/RedundantEqualityComparisonBlock
66 67 68 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 66 def has?(some_middleware) stack.any? { |middleware| middleware == some_middleware } end |
#insert(index_or_middleware, other_middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom Also known as: insert_before
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.
116 117 118 119 120 121 122 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 116 def insert(index_or_middleware, other_middleware) index = cast_index(index_or_middleware) stack.insert(index, other_middleware) self end |
#insert_after(index_or_middleware, other_middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom
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.
135 136 137 138 139 140 141 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 135 def insert_after(index_or_middleware, other_middleware) index = cast_index(index_or_middleware) stack.insert(index + 1, other_middleware) self end |
#insert_after_each(other_middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom
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.
157 158 159 160 161 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 157 def insert_after_each(other_middleware) @stack = stack.reduce([]) { |stack, middleware| stack.push(middleware, other_middleware) } self end |
#insert_before_each(other_middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom
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.
147 148 149 150 151 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 147 def insert_before_each(other_middleware) @stack = stack.reduce([]) { |stack, middleware| stack.push(other_middleware, middleware) } self end |
#replace(index_or_middleware, other_middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom
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.
169 170 171 172 173 174 175 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 169 def replace(index_or_middleware, other_middleware) index = cast_index(index_or_middleware) stack[index] = other_middleware self end |
#to_a ⇒ Array
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.
211 212 213 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 211 def to_a stack end |
#unshift(middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom Also known as: prepend
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.
84 85 86 87 88 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 84 def unshift(middleware) stack.unshift(middleware) self end |
#use(middleware) ⇒ ConvenientService::Support::Middleware::StackBuilder::Entities::Builders::Custom Also known as: append
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.
99 100 101 102 103 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 99 def use(middleware) stack << middleware self end |