Sha256: 71a70ee53f51d8233d6704a4403124dc2c199ddcbad991071010e4f4d1dde626

Contents?: true

Size: 480 Bytes

Versions: 37

Compression:

Stored size: 480 Bytes

Contents

# encoding: utf-8

require 'faraday'
require 'github_api/jsonable'

module Github
  class Response::Jsonize < Response
    include Github::Jsonable

    dependency 'multi_json'

    define_parser do |body|
      Github::Jsonable.decode body
    end

    def parse(body)
      case body
      when ''
        nil
      when 'true'
        true
      when 'false'
        false
      else
        self.class.parser.call body
      end
    end
  end # Response::Jsonize
end # Github

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
github_api-0.13.1 lib/github_api/response/jsonize.rb
github_api-0.13.0 lib/github_api/response/jsonize.rb
github_api-0.12.4 lib/github_api/response/jsonize.rb
github_api-0.12.3 lib/github_api/response/jsonize.rb
github_api-0.12.2 lib/github_api/response/jsonize.rb
github_api-0.12.1 lib/github_api/response/jsonize.rb
github_api-0.12.0 lib/github_api/response/jsonize.rb
github_api-0.11.3 lib/github_api/response/jsonize.rb
github_api-0.11.2 lib/github_api/response/jsonize.rb
github_api-0.11.1 lib/github_api/response/jsonize.rb
github_api-0.11.0 lib/github_api/response/jsonize.rb
github_api-0.10.2 lib/github_api/response/jsonize.rb
github_api-0.10.1 lib/github_api/response/jsonize.rb
github_api-0.10.0 lib/github_api/response/jsonize.rb
github_api-0.9.7 lib/github_api/response/jsonize.rb
github_api-0.9.6 lib/github_api/response/jsonize.rb
github_api-0.9.5 lib/github_api/response/jsonize.rb
github_api-0.9.4 lib/github_api/response/jsonize.rb
github_api-0.9.3 lib/github_api/response/jsonize.rb
github_api-0.9.2 lib/github_api/response/jsonize.rb