Class: Shogun::Dispatch::Payload

Inherits:
Object
  • Object
show all
Defined in:
lib/shogun/dispatch/payload.rb

Constant Summary collapse

QUERY_KEY =
"rack.request.query_hash"

Instance Method Summary collapse

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_hashObject



13
14
15
# File 'lib/shogun/dispatch/payload.rb', line 13

def to_hash
  @sections.inject(:merge)
end