lib/kapellmeister/responder.rb in kapellmeister-0.4.0 vs lib/kapellmeister/responder.rb in kapellmeister-0.4.2

- old
+ new

@@ -10,18 +10,18 @@ end def result error = !/2\d{2}/.match?(status.to_s) - Result.new(!error, parsed_body, { status: status }.merge(payload)) + Result.new(!error, parsed_body, { status: }.merge(payload)) rescue JSON::ParserError => e Result.new(false, e) end private def parsed_body - return body if body.length == 0 + return body if body.empty? case body when Hash then body else JSON.parse(body, symbolize_names: true, quirks_mode: true) end