Class: HttpClientGenerator::Plugs::UnderscoreResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/http_client_generator/plugs/underscore_response.rb

Instance Method Summary collapse

Instance Method Details

#call(req) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/http_client_generator/plugs/underscore_response.rb', line 8

def call(req)
  return req unless req.response_body.is_a?(Hash)

  req.response_body = req.response_body.deep_transform_keys { |k| k.to_s.underscore.to_sym }

  req
end