Class: Response::Rubyize

Inherits:
Middleware
  • Object
show all
Defined in:
lib/faraday/response/rubyize.rb

Instance Method Summary collapse

Instance Method Details

#parse(body) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/faraday/response/rubyize.rb', line 3

def parse(body)
  case body
  when Hash
    body.to_snake_keys
  when Array
    body.map { |item| parse(item) }
  else
    body
  end
end