Sha256: 38cf97e0f42e69907a326e490d338d2fd7bab1caf3a4c76a392c6da51ccc7dba

Contents?: true

Size: 415 Bytes

Versions: 17

Compression:

Stored size: 415 Bytes

Contents

# encoding: utf-8

require 'faraday'

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

    define_parser do |body|
      ::MultiJson.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

17 entries across 17 versions & 1 rubygems

Version Path
github_api-0.4.10 lib/github_api/response/jsonize.rb
github_api-0.4.9 lib/github_api/response/jsonize.rb
github_api-0.4.8 lib/github_api/response/jsonize.rb
github_api-0.4.7 lib/github_api/response/jsonize.rb
github_api-0.4.6 lib/github_api/response/jsonize.rb
github_api-0.4.5 lib/github_api/response/jsonize.rb
github_api-0.4.4 lib/github_api/response/jsonize.rb
github_api-0.4.3 lib/github_api/response/jsonize.rb
github_api-0.4.2 lib/github_api/response/jsonize.rb
github_api-0.4.1 lib/github_api/response/jsonize.rb
github_api-0.4.0 lib/github_api/response/jsonize.rb
github_api-0.3.9 lib/github_api/response/jsonize.rb
github_api-0.3.8 lib/github_api/response/jsonize.rb
github_api-0.3.7 lib/github_api/response/jsonize.rb
github_api-0.3.6 lib/github_api/response/jsonize.rb
github_api-0.3.4 lib/github_api/response/jsonize.rb
github_api-0.3.3 lib/github_api/response/jsonize.rb