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
- #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.
195 196 197 198 199 200 201 202 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 195 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.
70 71 72 73 74 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 70 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.
178 179 180 181 182 183 184 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 178 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.
214 215 216 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 214 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.
63 64 65 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 63 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.
112 113 114 115 116 117 118 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 112 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.
131 132 133 134 135 136 137 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 131 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.
153 154 155 156 157 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 153 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.
143 144 145 146 147 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 143 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.
165 166 167 168 169 170 171 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 165 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.
207 208 209 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 207 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.
80 81 82 83 84 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 80 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.
95 96 97 98 99 |
# File 'lib/convenient_service/support/middleware/stack_builder/entities/builders/custom.rb', line 95 def use(middleware) stack << middleware self end |