Class: FaradayMiddleware::Underscore
- Inherits:
-
Faraday::Response::Middleware
- Object
- Faraday::Response::Middleware
- FaradayMiddleware::Underscore
- Defined in:
- lib/faraday/underscore.rb
Overview
Converts parsed response bodies to underscored keys if bodies were of Hash type.
Instance Method Summary collapse
-
#initialize(app = nil, options = {}) ⇒ Underscore
constructor
A new instance of Underscore.
- #parse(body) ⇒ Object
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, = {}) 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 |