Class: Shogun::Dispatch::Lookup
- Inherits:
-
Object
- Object
- Shogun::Dispatch::Lookup
- Includes:
- Adamantium
- Defined in:
- lib/shogun/dispatch/lookup.rb
Instance Method Summary collapse
-
#initialize(routes:, verb:, path:) ⇒ Lookup
constructor
A new instance of Lookup.
- #payload ⇒ Object
- #request ⇒ Object
- #to_route ⇒ Object
Constructor Details
#initialize(routes:, verb:, path:) ⇒ Lookup
Returns a new instance of Lookup.
9 10 11 12 13 |
# File 'lib/shogun/dispatch/lookup.rb', line 9 def initialize(routes:, verb:, path:) @routes = routes @verb = verb @path = path end |
Instance Method Details
#payload ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/shogun/dispatch/lookup.rb', line 20 def payload if match.captures.any? match.names.zip(match.captures).to_h else {} end end |
#request ⇒ Object
15 16 17 |
# File 'lib/shogun/dispatch/lookup.rb', line 15 def request "#{@verb} #{@path}" end |