Class: Shogun::Dispatch::Payload
- Inherits:
-
Object
- Object
- Shogun::Dispatch::Payload
- Defined in:
- lib/shogun/dispatch/payload.rb
Constant Summary collapse
- QUERY_KEY =
"rack.request.query_hash"
Instance Method Summary collapse
-
#initialize(state:, lookup:) ⇒ Payload
constructor
A new instance of Payload.
- #to_hash ⇒ Object
Constructor Details
#initialize(state:, lookup:) ⇒ Payload
Returns a new instance of Payload.
6 7 8 9 10 11 |
# File 'lib/shogun/dispatch/payload.rb', line 6 def initialize(state:, lookup:) @body = state[Rack::BodyDeserializer::RACK_KEY] || {} @query = state[QUERY_KEY] || {} @uri = lookup.payload @sections = [state, @uri, @query, @body] end |
Instance Method Details
#to_hash ⇒ Object
13 14 15 |
# File 'lib/shogun/dispatch/payload.rb', line 13 def to_hash @sections.inject(:merge) end |