Sha256: 0a68bc8a9cb636163a7ac1d88d289849116170783fdace0f6de7458fc577c057

Contents?: true

Size: 468 Bytes

Versions: 6

Compression:

Stored size: 468 Bytes

Contents

# encoding: utf-8

require 'faraday'
require 'hashie'
require 'github_api/mash'

module Github
  class Response::Mashify < Response
    define_parser do |body|
      ::Github::Mash.new body
    end

    def parse(body)
      case body
      when Hash
        self.class.parser.call body
      when Array
        body.map { |item| item.is_a?(Hash) ? self.class.parser.call(item) : item }
      else
        body
      end
    end
  end # Response::Mashify
end # Github

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
github_api-0.19.0 lib/github_api/response/mashify.rb
lingfennan-github_api-0.18.2 lib/github_api/response/mashify.rb
github_api-0.18.2 lib/github_api/response/mashify.rb
github_api-0.18.1 lib/github_api/response/mashify.rb
github_api-0.17.0 lib/github_api/response/mashify.rb
github_api-0.16.0 lib/github_api/response/mashify.rb