Class: Toys::Middleware::Spec
- Inherits:
-
Object
- Object
- Toys::Middleware::Spec
- Defined in:
- core-docs/toys/middleware.rb
Overview
A middleware specification, including the middleware class and the arguments to pass to the constructor.
Use spec to create a middleware spec.
Defined in the toys-core gem
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)
182 183 184 |
# File 'core-docs/toys/middleware.rb', line 182 def args @args end |
#block ⇒ Proc? (readonly)
197 198 199 |
# File 'core-docs/toys/middleware.rb', line 197 def block @block end |
#kwargs ⇒ Hash? (readonly)
189 190 191 |
# File 'core-docs/toys/middleware.rb', line 189 def kwargs @kwargs end |
#name ⇒ String, ... (readonly)
174 175 176 |
# File 'core-docs/toys/middleware.rb', line 174 def name @name end |
#object ⇒ Toys::Middleware? (readonly)
167 168 169 |
# File 'core-docs/toys/middleware.rb', line 167 def object @object end |
Instance Method Details
#==(other) ⇒ boolean Also known as: eql?
Equality check
205 206 207 |
# File 'core-docs/toys/middleware.rb', line 205 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.
159 160 161 |
# File 'core-docs/toys/middleware.rb', line 159 def build(lookup) # Source available in the toys-core gem end |
#hash ⇒ Integer
Return the hash code
215 216 217 |
# File 'core-docs/toys/middleware.rb', line 215 def hash # Source available in the toys-core gem end |