Class: Toys::Middleware::Spec
- Inherits:
-
Object
- Object
- Toys::Middleware::Spec
- Defined in:
- core-docs/toys/middleware.rb
Overview
Defined in the toys-core gem
A middleware specification, including the middleware class and the arguments to pass to the constructor.
Use spec to create a middleware spec.
Instance Attribute Summary collapse
- #args ⇒ Array? readonly
- #block ⇒ Proc? readonly
- #kwargs ⇒ Hash? readonly
- #name ⇒ String, ... readonly
- #object ⇒ Toys::Middleware? readonly
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
(also: #eql?)
Equality check.
-
#build(lookup) ⇒ Toys::Middleware
Builds a middleware for this spec, given a ModuleLookup for middleware.
-
#hash ⇒ Integer
Return the hash code.
Instance Attribute Details
#args ⇒ Array? (readonly)
181 182 183 |
# File 'core-docs/toys/middleware.rb', line 181 def args @args end |
#block ⇒ Proc? (readonly)
196 197 198 |
# File 'core-docs/toys/middleware.rb', line 196 def block @block end |
#kwargs ⇒ Hash? (readonly)
188 189 190 |
# File 'core-docs/toys/middleware.rb', line 188 def kwargs @kwargs end |
#name ⇒ String, ... (readonly)
173 174 175 |
# File 'core-docs/toys/middleware.rb', line 173 def name @name end |
#object ⇒ Toys::Middleware? (readonly)
166 167 168 |
# File 'core-docs/toys/middleware.rb', line 166 def object @object end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Equality check
204 205 206 |
# File 'core-docs/toys/middleware.rb', line 204 def ==(other) # Source available in the toys-core gem end |
#build(lookup) ⇒ Toys::Middleware
Builds a middleware for this spec, given a ModuleLookup for middleware.
If this spec wraps an existing middleware object, returns that object. Otherwise, constructs a middleware object from the spec.
158 159 160 |
# File 'core-docs/toys/middleware.rb', line 158 def build(lookup) # Source available in the toys-core gem end |
#hash ⇒ Integer
Return the hash code
214 215 216 |
# File 'core-docs/toys/middleware.rb', line 214 def hash # Source available in the toys-core gem end |