Sha256: 0e716198f51e0432d2366b1b9efe62a6bc38671bfbe6c969d5cf14dd2ec5ffc1

Contents?: true

Size: 419 Bytes

Versions: 13

Compression:

Stored size: 419 Bytes

Contents

# encoding: utf-8

require 'faraday'
require 'json'

module Github
  class Response::Jsonize < Response

    dependency 'json'

    define_parser do |body|
      JSON.parse(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

13 entries across 13 versions & 2 rubygems

Version Path
github_api-0.19.0 lib/github_api/response/jsonize.rb
lingfennan-github_api-0.18.2 lib/github_api/response/jsonize.rb
github_api-0.18.2 lib/github_api/response/jsonize.rb
github_api-0.18.1 lib/github_api/response/jsonize.rb
github_api-0.17.0 lib/github_api/response/jsonize.rb
github_api-0.16.0 lib/github_api/response/jsonize.rb
github_api-0.15.0 lib/github_api/response/jsonize.rb
github_api-0.14.5 lib/github_api/response/jsonize.rb
github_api-0.14.4 lib/github_api/response/jsonize.rb
github_api-0.14.3 lib/github_api/response/jsonize.rb
github_api-0.14.2 lib/github_api/response/jsonize.rb
github_api-0.14.1 lib/github_api/response/jsonize.rb
github_api-0.14.0 lib/github_api/response/jsonize.rb