Class: FaradayMiddleware::Underscore

Inherits:
Faraday::Response::Middleware
  • Object
show all
Defined in:
lib/faraday/underscore.rb

Overview

Converts parsed response bodies to underscored keys if bodies were of Hash type.

Instance Method Summary collapse

Constructor Details

#initialize(app = nil, options = {}) ⇒ Underscore

Returns a new instance of Underscore.



9
10
11
# File 'lib/faraday/underscore.rb', line 9

def initialize(app = nil, options = {})
  super(app)
end

Instance Method Details

#parse(body) ⇒ Object



13
14
15
# File 'lib/faraday/underscore.rb', line 13

def parse(body)
  convert_hash_keys body
end