No commit activity in last 3 years
No release in over 3 years
Faraday middleware for parsing JSON using the Oj parser.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

~> 0.9
< 1.0, >= 0.9.1
< 4.0, >= 2.0
 Project Readme

FaradayMiddleware::ParseOj Build Status

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.

Installation

# Gemfile
gem 'faraday_middleware-parse_oj', '~> 0.3.2'

or

$ gem install faraday_middleware-parse_oj

Usage

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')

Note

Starting from version 0.3 FaradayMiddleware::ParseOj supports only faraday versions 0.9 and higher.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request