Sha256: d18187db24f10cb14adf8e125117ea149f937945afb4e06e0299606e64dfcbf5

Contents?: true

Size: 346 Bytes

Versions: 10

Compression:

Stored size: 346 Bytes

Contents

# encoding: utf-8

require 'faraday'

module Github
  class Response::Jsonize < Faraday::Response::Middleware
    dependency 'multi_json'

    def parse(body)
      case body
      when ''
        nil
      when 'true'
        true
      when 'false'
        false
      else
        ::MultiJson.decode(body)
      end
    end
  end
end # Github

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
github_api-0.3.2 lib/github_api/response/jsonize.rb
github_api-0.3.1 lib/github_api/response/jsonize.rb
github_api-0.3.0 lib/github_api/response/jsonize.rb
github_api-0.2.2 lib/github_api/response/jsonize.rb
github_api-0.2.1 lib/github_api/response/jsonize.rb
github_api-0.2.0 lib/github_api/response/jsonize.rb
github_api-0.1.2 lib/github_api/response/jsonize.rb
github_api-0.1.1 lib/github_api/response/jsonize.rb
github_api-0.1.0 lib/github_api/response/jsonize.rb
github_api-0.1.0.pre lib/github_api/response/jsonize.rb