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.9.1 lib/github_api/response/jsonize.rb
github_api-0.9.0 lib/github_api/response/jsonize.rb
github_api-0.8.11 lib/github_api/response/jsonize.rb
github_api-0.8.10 lib/github_api/response/jsonize.rb
github_api-0.8.9 lib/github_api/response/jsonize.rb
github_api-0.8.8 lib/github_api/response/jsonize.rb
github_api-0.8.7 lib/github_api/response/jsonize.rb
github_api-0.8.6 lib/github_api/response/jsonize.rb
github_api-0.8.5 lib/github_api/response/jsonize.rb
github_api-0.8.4 lib/github_api/response/jsonize.rb
github_api-0.8.3 lib/github_api/response/jsonize.rb
github_api-0.8.2 lib/github_api/response/jsonize.rb
github_api-0.8.1 lib/github_api/response/jsonize.rb
github_api-0.8.0 lib/github_api/response/jsonize.rb
github_api-0.7.2 lib/github_api/response/jsonize.rb
github_api-0.7.1 lib/github_api/response/jsonize.rb
github_api-0.7.0 lib/github_api/response/jsonize.rb