lib/rack/app/singleton_methods/payload.rb in rack-app-5.7.0 vs lib/rack/app/singleton_methods/payload.rb in rack-app-5.8.0

- old
+ new

@@ -1,12 +1,9 @@ module Rack::App::SingletonMethods::Payload def payload(&block) - unless @payload_builder - @payload_builder = Rack::App::Payload::Builder.new - use(Rack::App::Middlewares::Payload::ParserSetter, @payload_builder) - end + @payload_builder ||= Rack::App::Payload::Builder.new @payload_builder.instance_exec(&block) if block - nil + @payload_builder end end