Sha256: 031474d56d1320903cfd59e3dbeda814599f095a7b9a1eae5fa91248c6a895ca
Contents?: true
Size: 493 Bytes
Versions: 10
Compression:
Stored size: 493 Bytes
Contents
# encoding: utf-8 require 'faraday' module Github class Response::Mashify < Faraday::Response::Middleware dependency 'hashie/mash' class << self attr_accessor :mash_class end self.mash_class = ::Hashie::Mash def parse(body) case body when Hash self.class.mash_class.new(body) when Array body.map { |item| item.is_a?(Hash) ? self.class.mash_class.new(item) : item } else body end end end end # Github
Version data entries
10 entries across 10 versions & 1 rubygems