A simple Faraday middleware that parses JSON responses. It is identical to FaradayMiddleware::ParseJson
from faraday_middleware
gem except that it uses Oj.load
instead of JSON.parse
.
# Gemfile
gem 'faraday_middleware-parse_oj', '~> 0.2'
or
$ gem install faraday_middleware-parse_oj
The same as FaradayMiddleware::ParseJson
:
require 'faraday_middleware/parse_oj'
connection = Faraday.new do |builder|
builder.response :oj
builder.adapter Faraday.default_adapter
end
connection.get('http://example.com/some.json')
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request